From 3ae8c00faa452551c008397f9cf024158ba7e73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pauli=20J=C3=A4rvinen?= Date: Sun, 18 Jun 2023 23:09:58 +0300 Subject: [PATCH] Fix a small bug caused by the refactoring commit 28c15f93 Clicking of the title of the "All tracks", "Playlist", or "Internet radio" views always started to play the first list item, even if the Shuffle mode was active. In this case, it was supposed to start playing from a random item. --- js/app/controllers/views/alltracksviewcontroller.js | 2 +- js/app/controllers/views/playlistviewcontroller.js | 2 +- js/app/controllers/views/radioviewcontroller.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/app/controllers/views/alltracksviewcontroller.js b/js/app/controllers/views/alltracksviewcontroller.js index 31dbc97ac..672e10346 100644 --- a/js/app/controllers/views/alltracksviewcontroller.js +++ b/js/app/controllers/views/alltracksviewcontroller.js @@ -35,7 +35,7 @@ angular.module('Music').controller('AllTracksViewController', [ _.each(_unsubFuncs, function(func) { func(); }); }); - function play(startIndex = 0) { + function play(startIndex = null) { playlistService.setPlaylist('alltracks', _tracks, startIndex); playlistService.publish('play'); } diff --git a/js/app/controllers/views/playlistviewcontroller.js b/js/app/controllers/views/playlistviewcontroller.js index ed379f75a..a354cc660 100644 --- a/js/app/controllers/views/playlistviewcontroller.js +++ b/js/app/controllers/views/playlistviewcontroller.js @@ -58,7 +58,7 @@ angular.module('Music').controller('PlaylistViewController', [ }); }; - function play(startIndex = 0) { + function play(startIndex = null) { let id = 'playlist-' + $scope.playlist.id; playlistService.setPlaylist(id, $scope.tracks, startIndex); playlistService.publish('play'); diff --git a/js/app/controllers/views/radioviewcontroller.js b/js/app/controllers/views/radioviewcontroller.js index bd5c665a4..d421d698a 100644 --- a/js/app/controllers/views/radioviewcontroller.js +++ b/js/app/controllers/views/radioviewcontroller.js @@ -75,7 +75,7 @@ angular.module('Music').controller('RadioViewController', [ ); } - function play(startIndex = 0) { + function play(startIndex = null) { playlistService.setPlaylist('radio', $scope.stations, startIndex); playlistService.publish('play'); }