aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-09-12 15:36:46 -0700
committerScott Jackson <daneren2005@gmail.com>2015-09-12 15:36:46 -0700
commit981a0c6ab6bc9b7da67cf60076064f291a39de49 (patch)
treebacfd8ebf55a70131eadc84d7a8c76d43d560f52 /app
parent634b118ebad3cd9f1e7987de7c58e52a7dfefc57 (diff)
downloaddsub-981a0c6ab6bc9b7da67cf60076064f291a39de49.tar.gz
dsub-981a0c6ab6bc9b7da67cf60076064f291a39de49.tar.bz2
dsub-981a0c6ab6bc9b7da67cf60076064f291a39de49.zip
Fix trying to save a play queue with a index of -1
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
index 64da9a13..442d3dc1 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
@@ -316,8 +316,15 @@ public class DownloadServiceLifecycleSupport {
@Override
protected Void doInBackground() throws Throwable {
try {
+ int index = state.currentPlayingIndex;
+ int position = state.currentPlayingPosition;
+ if(index == -1) {
+ index = 0;
+ position = 0;
+ }
+
MusicService musicService = MusicServiceFactory.getMusicService(downloadService);
- musicService.savePlayQueue(state.songs, state.songs.get(state.currentPlayingIndex), state.currentPlayingPosition, downloadService, null);
+ musicService.savePlayQueue(state.songs, state.songs.get(index), position, downloadService, null);
currentSavePlayQueueTask = null;
} catch (Exception e) {
Log.e(TAG, "Failed to save playing queue to server", e);