aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-01-16 19:21:09 -0800
committerScott Jackson <daneren2005@gmail.com>2014-01-16 19:21:09 -0800
commit21df175198b4137681da5ca63fd7032c5597b842 (patch)
treebb8f043ef60246316311347d35320f3e364d4843 /src
parenta0befc8d40b01b903ee0fa67a0ef32d6403888bb (diff)
downloaddsub-21df175198b4137681da5ca63fd7032c5597b842.tar.gz
dsub-21df175198b4137681da5ca63fd7032c5597b842.tar.bz2
dsub-21df175198b4137681da5ca63fd7032c5597b842.zip
Only delete podcasts when would normally call playNext
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java10
1 files changed, 5 insertions, 5 deletions
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();
}
});