pub fn queue_lock(db: &Database, state: &SharedPlayerState) -> Option<QueueLock>Expand description
The queue, and the playlist or record it is still exactly.
While the two match, the queue follows a playlist: an edit there is an edit here, quietly. The moment you rearrange the queue yourself, add to it, or let radio extend it, they stop matching and the playlist becomes a document you are editing rather than the thing you are listening to.
A record cannot be edited, so locking to one buys no following — only the ability to say what you are listening to, which is worth saying.
Derived rather than tracked, which is the whole reason it is simple. There is no flag to keep in sync, nothing to persist and nothing to migrate — and it cannot get stuck, because a queue that stops matching stops being locked and one that happens to match again is locked again. Playing a playlist shuffled scrambles the order on purpose, so that queue is not locked, which is the right answer rather than a special case.