1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-17 02:59:03 +01:00

Reset last played song when playlist is finished

This commit is contained in:
Jonas Kvinge 2020-05-10 13:08:29 +02:00
parent f35bbd89c9
commit 5d6b0fa329
2 changed files with 2 additions and 0 deletions

View File

@ -395,6 +395,7 @@ void Player::NextItem(Engine::TrackChangeFlags change) {
int i = active_playlist->next_row(ignore_repeat_track);
if (i == -1) {
app_->playlist_manager()->active()->set_current_row(i);
app_->playlist_manager()->active()->reset_last_played();
emit PlaylistFinished();
Stop();
return;

View File

@ -189,6 +189,7 @@ class Playlist : public QAbstractListModel {
int current_row() const;
int last_played_row() const;
void reset_last_played() { last_played_item_index_ = QPersistentModelIndex(); }
int next_row(bool ignore_repeat_track = false) const;
int previous_row(bool ignore_repeat_track = false) const;