Do not save playback position when watch history is disabled
This commit is contained in:
parent
8de5c53485
commit
5053d470f6
|
@ -1049,27 +1049,33 @@ public abstract class BasePlayer implements
|
||||||
private void savePlaybackState(final StreamInfo info, final long progress) {
|
private void savePlaybackState(final StreamInfo info, final long progress) {
|
||||||
if (info == null) return;
|
if (info == null) return;
|
||||||
if (DEBUG) Log.d(TAG, "savePlaybackState() called");
|
if (DEBUG) Log.d(TAG, "savePlaybackState() called");
|
||||||
final Disposable stateSaver = recordManager.saveStreamState(info, progress)
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
if (prefs.getBoolean(context.getString(R.string.enable_watch_history_key), true)) {
|
||||||
.doOnError((e) -> {
|
final Disposable stateSaver = recordManager.saveStreamState(info, progress)
|
||||||
if (DEBUG) e.printStackTrace();
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
})
|
.doOnError((e) -> {
|
||||||
.onErrorComplete()
|
if (DEBUG) e.printStackTrace();
|
||||||
.subscribe();
|
})
|
||||||
databaseUpdateReactor.add(stateSaver);
|
.onErrorComplete()
|
||||||
|
.subscribe();
|
||||||
|
databaseUpdateReactor.add(stateSaver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetPlaybackState(final PlayQueueItem queueItem) {
|
private void resetPlaybackState(final PlayQueueItem queueItem) {
|
||||||
if (queueItem == null) return;
|
if (queueItem == null) return;
|
||||||
final Disposable stateSaver = queueItem.getStream()
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
.flatMapCompletable(info -> recordManager.saveStreamState(info, 0))
|
if (prefs.getBoolean(context.getString(R.string.enable_watch_history_key), true)) {
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
final Disposable stateSaver = queueItem.getStream()
|
||||||
.doOnError((e) -> {
|
.flatMapCompletable(info -> recordManager.saveStreamState(info, 0))
|
||||||
if (DEBUG) e.printStackTrace();
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
})
|
.doOnError((e) -> {
|
||||||
.onErrorComplete()
|
if (DEBUG) e.printStackTrace();
|
||||||
.subscribe();
|
})
|
||||||
databaseUpdateReactor.add(stateSaver);
|
.onErrorComplete()
|
||||||
|
.subscribe();
|
||||||
|
databaseUpdateReactor.add(stateSaver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetPlaybackState(final StreamInfo info) {
|
public void resetPlaybackState(final StreamInfo info) {
|
||||||
|
|
Loading…
Reference in New Issue