Skip to content

Commit

Permalink
Fix #1213 - reset playlist current track indicator to first track onc…
Browse files Browse the repository at this point in the history
…e the list has been played to the end.

This only applies to stored playlists.
  • Loading branch information
michaelherger committed Nov 8, 2024
1 parent d2b7799 commit d36d810
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog9.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ <h2><a name="v9.0.0" id="v9.0.0"></a>Introducing... Lyrion Music Server Version
<li><a href="https://github.com/LMS-Community/slimserver/issues/1138">#1138</a> - "Add all songs" from search not working (thanks @darrel-k!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1146">#1146</a> - Restore partial Cometd support for CLI clients (thanks @sodface!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1203">#1203</a> - Fix display of album roles in the playlist (thanks @darrel-k!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/issues/1213">#1213</a> - Modify #CURRTRACK to first track when playlist finishes</li>
</ul>
<br />

Expand Down
2 changes: 1 addition & 1 deletion Slim/Control/Commands.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
6 changes: 5 additions & 1 deletion Slim/Player/Playlist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit d36d810

Please sign in to comment.