From 38c4a1ed859b67d753a81a4611e259dc65495769 Mon Sep 17 00:00:00 2001 From: Jared Fantaye Date: Tue, 22 Nov 2022 15:36:57 +0100 Subject: [PATCH] Fixed the "Remove Watched" bug Reverted changes and fixed bug in a different way --- .../local/playlist/LocalPlaylistFragment.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java index d584ceefb..68a35e72b 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java @@ -404,7 +404,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment { // Remove Watched, Functionality data - final List notWatchedItems = new ArrayList<>(); + final List itemsToKeep = new ArrayList<>(); final boolean isThumbnailPermanent = playlistManager .getIsPlaylistThumbnailPermanent(playlistId); boolean thumbnailVideoRemoved = false; @@ -415,7 +415,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment(notWatchedItems, thumbnailVideoRemoved); + return new Pair<>(itemsToKeep, thumbnailVideoRemoved); }); disposables.add(streamsMaybe.subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(flow -> { - final List notWatchedItems = flow.first; + final List itemsToKeep = flow.first; final boolean thumbnailVideoRemoved = flow.second; itemListAdapter.clearStreamItemList(); - itemListAdapter.addItems(notWatchedItems); + itemListAdapter.addItems(itemsToKeep); saveChanges(); if (thumbnailVideoRemoved) {