summaryrefslogtreecommitdiff
path: root/src/queue
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-07-01 16:56:17 +0200
committerMax Kellermann <max@musicpd.org>2020-07-01 16:56:17 +0200
commit3d7147390f76ea33bf46424be67d696965de0745 (patch)
treec9455d301fef7aa58bfaad8df3f88e1dd9c7ea7a /src/queue
parent3c5ef504f86c3adad2530101e0f832cec0341c97 (diff)
parentca705e1e37e2cd20d89e707c51cdb33a4d33245e (diff)
Merge branch 'v0.21.x'
Diffstat (limited to 'src/queue')
-rw-r--r--src/queue/PlaylistEdit.cxx9
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();
}