From 0d3eebaf1940c8fb6e604df6a1da33dcbb5b99e1 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 22 Jan 2014 21:43:08 -0800 Subject: Fix a few places where the index wasn't properly updated --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index a50d2fe8..e1ea56ef 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -414,6 +414,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { downloadList.remove(getCurrentPlayingIndex()); downloadList.add(0, currentPlaying); } + currentPlayingIndex = downloadList.indexOf(currentPlaying); revision++; lifecycleSupport.serializeDownloadQueue(); updateJukeboxPlaylist(); @@ -557,6 +558,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { @Override public synchronized void remove(int which) { downloadList.remove(which); + currentPlayingIndex = downloadList.indexOf(currentPlaying); } @Override @@ -570,6 +572,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { setCurrentPlaying(null, false); } downloadList.remove(downloadFile); + currentPlayingIndex = downloadList.indexOf(currentPlaying); backgroundDownloadList.remove(downloadFile); revision++; lifecycleSupport.serializeDownloadQueue(); @@ -1546,6 +1549,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { revision++; } } + currentPlayingIndex = downloadList.indexOf(currentPlaying); if (revisionBefore != revision) { updateJukeboxPlaylist(); -- cgit v1.2.3