BrowsePresenter: local history sync fix; upd MediaServiceCore

This commit is contained in:
Yuriy Liskov
2026-03-12 01:21:29 +02:00
parent 28dd2a64d4
commit 4bccb44a40
3 changed files with 10 additions and 2 deletions

View File

@@ -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() {

View File

@@ -1220,7 +1220,9 @@ public class BrowsePresenter extends BasePresenter<BrowseView> implements Sectio
}
for (State state : stateService.getStates()) {
videoGroup.add(0, state.video);
if (state.timestamp > stateService.getSessionStartTimeMs()) {
videoGroup.add(0, state.video);
}
}
}
}