From e2aa83f047e8ca762c19290a620fe47d154b74eb Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 2 Dec 2019 12:00:21 +0100 Subject: [PATCH] Remove queue item without checking taskmanager first --- .../service/playback/PlaybackService.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index b43e62519..d53f7d669 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -985,23 +985,15 @@ public class PlaybackService extends MediaBrowserServiceCompat { } if (item != null) { - if (ended || smartMarkAsPlayed || - (skipped && !UserPreferences.shouldSkipKeepEpisode())) { + if (ended || smartMarkAsPlayed + || (skipped && !UserPreferences.shouldSkipKeepEpisode())) { // only mark the item as played if we're not keeping it anyways DBWriter.markItemPlayed(item, FeedItem.PLAYED, ended); - try { - final List queue = taskManager.getQueue(); - if (QueueAccess.ItemListAccess(queue).contains(item.getId())) { - // don't know if it actually matters to not autodownload when smart mark as played is triggered - DBWriter.removeQueueItem(PlaybackService.this, ended, item); - } - } catch (InterruptedException e) { - e.printStackTrace(); - // isInQueue remains false - } + // don't know if it actually matters to not autodownload when smart mark as played is triggered + DBWriter.removeQueueItem(PlaybackService.this, ended, item); // Delete episode if enabled - if (item.getFeed().getPreferences().getCurrentAutoDelete() && - (!item.isTagged(FeedItem.TAG_FAVORITE) || !UserPreferences.shouldFavoriteKeepEpisode())) { + if (item.getFeed().getPreferences().getCurrentAutoDelete() + && (!item.isTagged(FeedItem.TAG_FAVORITE) || !UserPreferences.shouldFavoriteKeepEpisode())) { DBWriter.deleteFeedMediaOfItem(PlaybackService.this, media.getId()); Log.d(TAG, "Episode Deleted"); }