diff options
Diffstat (limited to 'src/github/daneren2005/dsub/service/DownloadService.java')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index ef69c9d3..473815dc 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1654,12 +1654,7 @@ public class DownloadService extends Service { Log.i(TAG, "Ending position " + pos + " of " + duration); if (!isPartial || (downloadFile.isWorkDone() && (Math.abs(duration - pos) < 10000)) || nextSetup) { playNext(); - - // Finished loading, delete when list is cleared - if (downloadFile.getSong() instanceof PodcastEpisode) { - toDelete.add(downloadFile); - } - clearCurrentBookmark(downloadFile.getSong(), true); + postPlayCleanup(downloadFile); } else { // If file is not completely downloaded, restart the playback from the current position. synchronized (DownloadService.this) { @@ -1941,6 +1936,17 @@ public class DownloadService extends Service { } } } + + public void postPlayCleanup() { + postPlayCleanup(currentPlaying); + } + public void postPlayCleanup(DownloadFile downloadFile) { + // Finished loading, delete when list is cleared + if (downloadFile.getSong() instanceof PodcastEpisode) { + toDelete.add(downloadFile); + } + clearCurrentBookmark(downloadFile.getSong(), true); + } private boolean isPastCutoff() { return isPastCutoff(getPlayerPosition(), getPlayerDuration()); |