aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-02-20 07:27:54 -0800
committerScott Jackson <daneren2005@gmail.com>2013-02-20 07:27:54 -0800
commitea08c8902fe35320122aa9402af499ae07b586b7 (patch)
treebcdbf27a97d91e5ed53b390ccdb3e91f8dfcda6d
parent476d6e833c5ede638eea823d056341e018d8292d (diff)
downloaddsub-ea08c8902fe35320122aa9402af499ae07b586b7.tar.gz
dsub-ea08c8902fe35320122aa9402af499ae07b586b7.tar.bz2
dsub-ea08c8902fe35320122aa9402af499ae07b586b7.zip
Fix a bunch of corner cases for when need to change nextPlaying
-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);
}