Skip to content

Commit 4e401bc

Browse files
committed
Update playlists in parallel
1 parent 9ecef6f commit 4e401bc

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/bookmark/BookmarkFragment.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -454,21 +454,16 @@ public void saveImmediate() {
454454

455455
// 1. Update local playlists
456456
// 2. Update remote playlists
457-
// 3. Set isModified false
457+
// 3. Set NoChangesToSave
458458
disposables.add(localPlaylistManager.updatePlaylists(localItemsUpdate, localItemsDeleteUid)
459+
.mergeWith(remotePlaylistManager.updatePlaylists(
460+
remoteItemsUpdate, remoteItemsDeleteUid))
459461
.observeOn(AndroidSchedulers.mainThread())
460-
.subscribe(() -> disposables.add(remotePlaylistManager.updatePlaylists(
461-
remoteItemsUpdate, remoteItemsDeleteUid)
462-
.observeOn(AndroidSchedulers.mainThread())
463-
.subscribe(() -> {
464-
if (debounceSaver != null) {
465-
debounceSaver.setNoChangesToSave();
466-
}
467-
},
468-
throwable -> showError(new ErrorInfo(throwable,
469-
UserAction.REQUESTED_BOOKMARK,
470-
"Saving playlist"))
471-
)),
462+
.subscribe(() -> {
463+
if (debounceSaver != null) {
464+
debounceSaver.setNoChangesToSave();
465+
}
466+
},
472467
throwable -> showError(new ErrorInfo(throwable,
473468
UserAction.REQUESTED_BOOKMARK, "Saving playlist"))
474469
));

0 commit comments

Comments
 (0)