fix issue #7563
This commit is contained in:
parent
6e81f2430b
commit
8ea98b64aa
|
@ -414,14 +414,21 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
|
||||||
} else {
|
} else {
|
||||||
final Iterator<StreamStateEntity> streamStatesIter = recordManager
|
final Iterator<StreamStateEntity> streamStatesIter = recordManager
|
||||||
.loadLocalStreamStateBatch(playlist).blockingGet().iterator();
|
.loadLocalStreamStateBatch(playlist).blockingGet().iterator();
|
||||||
|
|
||||||
while (playlistIter.hasNext()) {
|
while (playlistIter.hasNext()) {
|
||||||
final PlaylistStreamEntry playlistItem = playlistIter.next();
|
final PlaylistStreamEntry playlistItem = playlistIter.next();
|
||||||
final int indexInHistory = Collections.binarySearch(historyStreamIds,
|
final int indexInHistory = Collections.binarySearch(historyStreamIds,
|
||||||
playlistItem.getStreamId());
|
playlistItem.getStreamId());
|
||||||
|
final StreamStateEntity streamStateEntity = streamStatesIter.next();
|
||||||
final boolean hasState = streamStatesIter.next() != null;
|
final long duration = playlistItem.toStreamInfoItem().getDuration();
|
||||||
if (indexInHistory < 0 || hasState) {
|
boolean isFinished = false;
|
||||||
|
if (streamStateEntity != null) {
|
||||||
|
isFinished = streamStateEntity.isFinished(duration);
|
||||||
|
}
|
||||||
|
final boolean isNotWatchedItem = (streamStateEntity != null
|
||||||
|
&& !isFinished);
|
||||||
|
if (indexInHistory < 0) {
|
||||||
|
notWatchedItems.add(playlistItem);
|
||||||
|
} else if (isNotWatchedItem) {
|
||||||
notWatchedItems.add(playlistItem);
|
notWatchedItems.add(playlistItem);
|
||||||
} else if (!thumbnailVideoRemoved
|
} else if (!thumbnailVideoRemoved
|
||||||
&& playlistManager.getPlaylistThumbnail(playlistId)
|
&& playlistManager.getPlaylistThumbnail(playlistId)
|
||||||
|
|
Loading…
Reference in New Issue