From 4bccb44a401e47f66b3643729d1523ca57dcef6e Mon Sep 17 00:00:00 2001 From: Yuriy Liskov Date: Thu, 12 Mar 2026 01:21:29 +0200 Subject: [PATCH] BrowsePresenter: local history sync fix; upd MediaServiceCore --- MediaServiceCore | 2 +- .../app/models/playback/service/VideoStateService.java | 6 ++++++ .../common/app/presenters/BrowsePresenter.java | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MediaServiceCore b/MediaServiceCore index 467e0bc4b..7e0a31bee 160000 --- a/MediaServiceCore +++ b/MediaServiceCore @@ -1 +1 @@ -Subproject commit 467e0bc4bdce0cd68882a5f2e6e4523647d6a9e4 +Subproject commit 7e0a31bee01bcf171280243dc9096e0a7ab99c96 diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java index 6d59f8aad..4d66851e5 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/service/VideoStateService.java @@ -27,6 +27,7 @@ public class VideoStateService implements ProfileChangeListener { private static final String DELIM = "&si;"; private boolean mIsHistoryBroken; private final Runnable mPersistStateInt = this::persistStateInt; + private long mSessionStartTimeMs; private VideoStateService(Context context) { mPrefs = AppPrefs.instance(context); @@ -93,6 +94,10 @@ public class VideoStateService implements ProfileChangeListener { return mIsHistoryBroken; } + public long getSessionStartTimeMs() { + return mSessionStartTimeMs; + } + private void restoreState() { mStates.clear(); String data = mPrefs.getStateUpdaterData(); @@ -101,6 +106,7 @@ public class VideoStateService implements ProfileChangeListener { setStateData(Helpers.parseStr(split, 0)); mIsHistoryBroken = Helpers.parseBoolean(split, 1); + mSessionStartTimeMs = System.currentTimeMillis(); } private void persistStateInt() { diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java index 38c681161..6ce595663 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java @@ -1220,7 +1220,9 @@ public class BrowsePresenter extends BasePresenter implements Sectio } for (State state : stateService.getStates()) { - videoGroup.add(0, state.video); + if (state.timestamp > stateService.getSessionStartTimeMs()) { + videoGroup.add(0, state.video); + } } } }