mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-03-13 15:20:26 +08:00
BrowsePresenter: local history sync fix; upd MediaServiceCore
This commit is contained in:
Submodule MediaServiceCore updated: 467e0bc4bd...7e0a31bee0
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user