From 9e5a755dce7de38e5bb930132327177ca62f1eed Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Mon, 28 Apr 2014 12:54:17 -0700 Subject: #339 Fix two cases of drag/drop wrong next playing 1) Fix when dragging the song that is playing somewhere else continuing onto the previously next song. 2) Fix #339. The check was correct, but the currentPlayingIndex was not being updated before doing the check. --- src/github/daneren2005/dsub/service/DownloadService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 66295d5e..f4edb004 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1521,10 +1521,11 @@ public class DownloadService extends Service { int currentPlayingIndex = getCurrentPlayingIndex(); DownloadFile movedSong = list.remove(from); list.add(to, movedSong); + currentPlayingIndex = downloadList.indexOf(currentPlaying); if(remoteState != RemoteControlState.LOCAL && mainList) { updateJukeboxPlaylist(); - } else if(mainList && (movedSong == nextPlaying || (currentPlayingIndex + 1) == to)) { - // Moving next playing or moving a song to be next playing + } else if(mainList && (movedSong == nextPlaying || movedSong == currentPlaying || (currentPlayingIndex + 1) == to)) { + // Moving next playing, current playing, or moving a song to be next playing setNextPlaying(); } } -- cgit v1.2.3