1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00

Update playlists in parallel

This commit is contained in:
GGAutomaton 2022-06-23 20:36:21 +08:00
parent 9ecef6f011
commit 4e401bc059

View File

@ -454,21 +454,16 @@ public final class BookmarkFragment extends BaseLocalListFragment<List<PlaylistL
// 1. Update local playlists // 1. Update local playlists
// 2. Update remote playlists // 2. Update remote playlists
// 3. Set isModified false // 3. Set NoChangesToSave
disposables.add(localPlaylistManager.updatePlaylists(localItemsUpdate, localItemsDeleteUid) disposables.add(localPlaylistManager.updatePlaylists(localItemsUpdate, localItemsDeleteUid)
.observeOn(AndroidSchedulers.mainThread()) .mergeWith(remotePlaylistManager.updatePlaylists(
.subscribe(() -> disposables.add(remotePlaylistManager.updatePlaylists( remoteItemsUpdate, remoteItemsDeleteUid))
remoteItemsUpdate, remoteItemsDeleteUid)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(() -> { .subscribe(() -> {
if (debounceSaver != null) { if (debounceSaver != null) {
debounceSaver.setNoChangesToSave(); debounceSaver.setNoChangesToSave();
} }
}, },
throwable -> showError(new ErrorInfo(throwable,
UserAction.REQUESTED_BOOKMARK,
"Saving playlist"))
)),
throwable -> showError(new ErrorInfo(throwable, throwable -> showError(new ErrorInfo(throwable,
UserAction.REQUESTED_BOOKMARK, "Saving playlist")) UserAction.REQUESTED_BOOKMARK, "Saving playlist"))
)); ));