From d36d81054d9fd1cd8f2db0ca9795fe63730e1b1b Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Fri, 8 Nov 2024 17:15:34 +0100 Subject: [PATCH] Fix #1213 - reset playlist current track indicator to first track once the list has been played to the end. This only applies to stored playlists. --- Changelog9.html | 1 + Slim/Control/Commands.pm | 2 +- Slim/Player/Playlist.pm | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changelog9.html b/Changelog9.html index 111876ee3ff..4457ebec685 100644 --- a/Changelog9.html +++ b/Changelog9.html @@ -47,6 +47,7 @@

Introducing... Lyrion Music Server Version
  • #1138 - "Add all songs" from search not working (thanks @darrel-k!)
  • #1146 - Restore partial Cometd support for CLI clients (thanks @sodface!)
  • #1203 - Fix display of album roles in the playlist (thanks @darrel-k!)
  • +
  • #1213 - Modify #CURRTRACK to first track when playlist finishes

  • diff --git a/Slim/Control/Commands.pm b/Slim/Control/Commands.pm index 73829772084..6ffb0a08c52 100644 --- a/Slim/Control/Commands.pm +++ b/Slim/Control/Commands.pm @@ -1763,7 +1763,7 @@ sub playlistXtracksCommand { # And set a callback so that we can # update CURTRACK when the song changes. - Slim::Control::Request::subscribe(\&Slim::Player::Playlist::newSongPlaylistCallback, [['playlist'], ['newsong']]); + Slim::Control::Request::subscribe(\&Slim::Player::Playlist::newSongPlaylistCallback, [['playlist'], ['newsong', 'stop']]); } # bug 14662: Playing a specific track while track shuffle is enabled will play another track elsif (defined $jumpToIndex && Slim::Player::Playlist::shuffle($client)) { diff --git a/Slim/Player/Playlist.pm b/Slim/Player/Playlist.pm index 00b7df044e3..067648ee7fa 100644 --- a/Slim/Player/Playlist.pm +++ b/Slim/Player/Playlist.pm @@ -1100,7 +1100,11 @@ sub newSongPlaylistCallback { my $client = $request->client() || return; - newSongPlaylist($client) + my $reset = $request->isCommand([['playlist'], ['stop']]) + && (Slim::Player::Source::playingSongIndex($client) + 1) == count($client) + && !Slim::Player::Source::progress($client); + + newSongPlaylist($client, $reset); }