Load only the selected group and customizable updated status timeout
Now only the subscriptions from the selected group by the user will be loaded. Also add an option to decide how much time have to pass since the last refresh before the subscription is deemed as not up to date. This helps when a subscription appear in multiple groups, since updating in one will not require to be fetched again in the others.
This commit is contained in:
parent
2948e4190b
commit
b2f317ab7c
20 changed files with 412 additions and 123 deletions
|
|
@ -1246,12 +1246,22 @@ public class VideoDetailFragment
|
|||
final boolean playbackResumeEnabled =
|
||||
prefs.getBoolean(activity.getString(R.string.enable_watch_history_key), true)
|
||||
&& prefs.getBoolean(activity.getString(R.string.enable_playback_resume_key), true);
|
||||
|
||||
if (!playbackResumeEnabled || info.getDuration() <= 0) {
|
||||
positionView.setVisibility(View.INVISIBLE);
|
||||
detailPositionView.setVisibility(View.GONE);
|
||||
return;
|
||||
|
||||
// TODO: Remove this check when separation of concerns is done.
|
||||
// (live streams weren't getting updated because they are mixed)
|
||||
if (!info.getStreamType().equals(StreamType.LIVE_STREAM) &&
|
||||
!info.getStreamType().equals(StreamType.AUDIO_LIVE_STREAM)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final HistoryRecordManager recordManager = new HistoryRecordManager(requireContext());
|
||||
|
||||
// TODO: Separate concerns when updating database data.
|
||||
// (move the updating part to when the loading happens)
|
||||
positionSubscriber = recordManager.loadStreamState(info)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.onErrorComplete()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue