From 21df175198b4137681da5ca63fd7032c5597b842 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 16 Jan 2014 19:21:09 -0800 Subject: Only delete podcasts when would normally call playNext --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 2f3dce53..170c549b 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -1300,6 +1300,11 @@ public class DownloadServiceImpl extends Service implements DownloadService { Log.i(TAG, "Ending position " + pos + " of " + duration); if (!isPartial || (downloadFile.isWorkDone() && (Math.abs(duration - pos) < 10000))) { playNext(); + + // Finished loading, delete when list is cleared + if(downloadFile.getSong() instanceof PodcastEpisode) { + toDelete.add(downloadFile); + } } else { // If file is not completely downloaded, restart the playback from the current position. synchronized (DownloadServiceImpl.this) { @@ -1319,11 +1324,6 @@ public class DownloadServiceImpl extends Service implements DownloadService { } } - // Finished loading, delete when list is cleared - if(downloadFile.getSong() instanceof PodcastEpisode) { - toDelete.add(downloadFile); - } - wakeLock.release(); } }); -- cgit v1.2.3