aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 4697f3a5..8aee7e3f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -335,6 +335,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
revision++;
lifecycleSupport.serializeDownloadQueue();
updateJukeboxPlaylist();
+ setNextPlaying();
}
@Override
@@ -345,6 +346,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
@Override
public void setRepeatMode(RepeatMode repeatMode) {
Util.setRepeatMode(this, repeatMode);
+ setNextPlaying();
}
@Override
@@ -442,6 +444,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
lifecycleSupport.serializeDownloadQueue();
}
updateJukeboxPlaylist();
+ setNextPlaying();
}
@Override
@@ -459,6 +462,9 @@ public class DownloadServiceImpl extends Service implements DownloadService {
revision++;
lifecycleSupport.serializeDownloadQueue();
updateJukeboxPlaylist();
+ if(downloadFile == nextPlaying) {
+ setNextPlaying();
+ }
}
@Override
@@ -521,12 +527,15 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
}
- if(index < size()) {
+ if(index < size() && index != -1) {
nextPlaying = downloadList.get(index);
nextPlayingTask = new CheckCompletionTask(nextPlaying);
nextPlayingTask.start();
} else {
nextPlaying = null;
+ if(nextPlayingTask != null) {
+ nextPlayingTask.cancel();
+ }
nextPlayingTask = null;
setNextPlayerState(IDLE);
}