Skip to content

Commit

Permalink
Fix a small bug caused by the refactoring commit 28c15f9
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paulijar committed Jun 18, 2023
1 parent 152e7ed commit 3ae8c00
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/app/controllers/views/alltracksviewcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion js/app/controllers/views/playlistviewcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion js/app/controllers/views/radioviewcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 3ae8c00

Please sign in to comment.