From 65c4a72291abc23932356d7622e77a2c42fe6c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Thomas?= Date: Fri, 28 Oct 2016 22:45:47 +0200 Subject: [PATCH] Fix #71: Move current track to to when shuffling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François-Xavier Thomas --- .../src/main/java/org/libresonic/player/domain/PlayQueue.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/domain/PlayQueue.java b/libresonic-main/src/main/java/org/libresonic/player/domain/PlayQueue.java index 16401e34..2cc2ae42 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/domain/PlayQueue.java +++ b/libresonic-main/src/main/java/org/libresonic/player/domain/PlayQueue.java @@ -241,7 +241,8 @@ public class PlayQueue { MediaFile currentFile = getCurrentFile(); Collections.shuffle(files); if (currentFile != null) { - index = files.indexOf(currentFile); + Collections.swap(files, files.indexOf(currentFile), 0); + index = 0; } }