Skip to content

Commit a1435bd

Browse files
authored
Merge pull request #8259 from LingYinTianMeng/dev
Fix removing only fully watched videos from playlist
2 parents 8f34f69 + 59d8c57 commit a1435bd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,11 @@ public void removeWatchedStreams(final boolean removePartiallyWatched) {
419419
final PlaylistStreamEntry playlistItem = playlistIter.next();
420420
final int indexInHistory = Collections.binarySearch(historyStreamIds,
421421
playlistItem.getStreamId());
422+
final StreamStateEntity streamStateEntity = streamStatesIter.next();
423+
final long duration = playlistItem.toStreamInfoItem().getDuration();
422424

423-
final boolean hasState = streamStatesIter.next() != null;
424-
if (indexInHistory < 0 || hasState) {
425+
if (indexInHistory < 0 || (streamStateEntity != null
426+
&& !streamStateEntity.isFinished(duration))) {
425427
notWatchedItems.add(playlistItem);
426428
} else if (!thumbnailVideoRemoved
427429
&& playlistManager.getPlaylistThumbnail(playlistId)

0 commit comments

Comments
 (0)