From 90e63817d086dd81debfa6735ed714f6487c343d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Thomas?= Date: Tue, 18 Feb 2020 23:57:52 +0100 Subject: [PATCH] Remove unused 'index' parameter from DWR addPlaylist method --- .../airsonic/player/ajax/PlayQueueService.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/ajax/PlayQueueService.java b/airsonic-main/src/main/java/org/airsonic/player/ajax/PlayQueueService.java index f3a1e7de..7b7e5399 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/ajax/PlayQueueService.java +++ b/airsonic-main/src/main/java/org/airsonic/player/ajax/PlayQueueService.java @@ -252,31 +252,20 @@ public class PlayQueueService { return doPlayInternetRadio(request, player, radio).setStartPlayerAt(0); } - /** - * @param index Start playing at this index, or play whole playlist if {@code null}. - */ - public PlayQueueInfo addPlaylist(int id, Integer index) throws Exception { + public PlayQueueInfo addPlaylist(int id) throws Exception { HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); HttpServletResponse response = WebContextFactory.get().getHttpServletResponse(); String username = securityService.getCurrentUsername(request); - boolean queueFollowingSongs = settingsService.getUserSettings(username).isQueueFollowingSongs(); List files = playlistService.getFilesInPlaylist(id, true); - if (!files.isEmpty() && index != null) { - if (queueFollowingSongs) { - files = files.subList(index, files.size()); - } else { - files = Arrays.asList(files.get(index)); - } - } // Remove non-present files files.removeIf(file -> !file.isPresent()); // Add to the play queue int[] ids = files.stream().mapToInt(f -> f.getId()).toArray(); - return doAdd(request, response, ids, index); + return doAdd(request, response, ids, null); } /**