From 89a6640791144d5f562c9a5bfb70056d075633e8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 9 Oct 2015 16:32:04 -0700 Subject: #559 Don't remove offline id's from serialized state, just from state sent to Subsonic --- app/src/main/AndroidManifest.xml | 2 +- .../daneren2005/dsub/provider/DSubWidgetProvider.java | 12 ++++++++---- .../dsub/service/DownloadServiceLifecycleSupport.java | 17 +++++++++++------ 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'app/src') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 152375a4..eeb0cc75 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ songs, boolean serializeRemote) { final PlayerQueue state = new PlayerQueue(); for (DownloadFile downloadFile : songs) { - MusicDirectory.Entry song = downloadFile.getSong(); - if(song.isOnlineId(downloadService)) { - state.songs.add(downloadFile.getSong()); - } + state.songs.add(downloadFile.getSong()); } for (DownloadFile downloadFile : downloadService.getToDelete()) { state.toDelete.add(downloadFile.getSong()); @@ -324,11 +321,19 @@ public class DownloadServiceLifecycleSupport { position = 0; } + MusicDirectory.Entry currentPlaying = state.songs.get(index); + List songs = new ArrayList<>(); + for(MusicDirectory.Entry song: state.songs) { + if(song.isOnlineId(downloadService)) { + songs.add(song); + } + } + MusicService musicService = MusicServiceFactory.getMusicService(downloadService); - musicService.savePlayQueue(state.songs, state.songs.get(index), position, downloadService, null); - currentSavePlayQueueTask = null; + musicService.savePlayQueue(songs, currentPlaying, position, downloadService, null); } catch (Exception e) { Log.e(TAG, "Failed to save playing queue to server", e); + } finally { currentSavePlayQueueTask = null; } -- cgit v1.2.3