diff options
author | Max Kellermann <max@musicpd.org> | 2020-07-01 16:56:17 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-07-01 16:56:17 +0200 |
commit | 3d7147390f76ea33bf46424be67d696965de0745 (patch) | |
tree | c9455d301fef7aa58bfaad8df3f88e1dd9c7ea7a /src/queue | |
parent | 3c5ef504f86c3adad2530101e0f832cec0341c97 (diff) | |
parent | ca705e1e37e2cd20d89e707c51cdb33a4d33245e (diff) |
Merge branch 'v0.21.x'
Diffstat (limited to 'src/queue')
-rw-r--r-- | src/queue/PlaylistEdit.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/queue/PlaylistEdit.cxx b/src/queue/PlaylistEdit.cxx index fb03b4e6d..b0b929bd5 100644 --- a/src/queue/PlaylistEdit.cxx +++ b/src/queue/PlaylistEdit.cxx @@ -430,6 +430,8 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id, if (position < 0) throw PlaylistError::NoSuchSong(); + bool was_queued = false; + if (playing) { if (position == current) throw PlaylistError(PlaylistResult::DENIED, @@ -441,6 +443,10 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id, already; cancel that */ pc.LockCancel(); queued = -1; + + /* schedule a call to UpdateQueuedSong() to + re-queue the song with its new range */ + was_queued = true; } } @@ -463,7 +469,8 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id, song.SetEndTime(end); /* announce the change to all interested subsystems */ - UpdateQueuedSong(pc, nullptr); + if (was_queued) + UpdateQueuedSong(pc, nullptr); queue.ModifyAtPosition(position); OnModified(); } |