Check if already running before removing watched

This commit is contained in:
Stypox 2020-04-03 20:34:01 +02:00
parent 6571fdbaa2
commit 92ca1e6e09
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23

View file

@ -369,12 +369,11 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
}
public void removeWatchedStreams() {
showLoading();
if (removeWatchedDisposable != null) {
// In case this is called twice
removeWatchedDisposable.dispose();
if (removeWatchedDisposable != null && !removeWatchedDisposable.isDisposed()) {
// already running
return;
}
showLoading();
removeWatchedDisposable = Flowable.just(
playlistManager.getPlaylistStreams(playlistId).blockingFirst())
@ -431,8 +430,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
}
hideLoading();
}, this::onError
);
}, this::onError);
}
@Override