From 1c38860b00a06e73ff36db951d9d7ddbc7a13d78 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 30 Jan 2014 14:57:24 -0800 Subject: Fix shuffle creating bogus copies of now playing entry --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index e1ea56ef..cba71f8c 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -410,11 +410,12 @@ public class DownloadServiceImpl extends Service implements DownloadService { @Override public synchronized void shuffle() { Collections.shuffle(downloadList); + currentPlayingIndex = downloadList.indexOf(currentPlaying); if (currentPlaying != null) { downloadList.remove(getCurrentPlayingIndex()); downloadList.add(0, currentPlaying); + currentPlayingIndex = 0; } - currentPlayingIndex = downloadList.indexOf(currentPlaying); revision++; lifecycleSupport.serializeDownloadQueue(); updateJukeboxPlaylist(); -- cgit v1.2.3