diff --git a/server/routes/assignments.js b/server/routes/assignments.js index 967353e..bf8e42c 100644 --- a/server/routes/assignments.js +++ b/server/routes/assignments.js @@ -160,20 +160,58 @@ function checkItemWrite(req, res) { return item; } -// #129: real-time mute. Tell every device on this playlist to toggle the volume of the -// matching currently-playing item NOW (decoupled from publish — the device matches by -// content_id/widget_id and applies it live). The new value is also written to the row, so -// it lands in the next published snapshot and persists across playlist reloads. +// #129 + mute-fix: per-item mute has to do TWO things, because the device plays from +// playlists.published_snapshot (deviceSocket.buildPlaylistPayload), NOT the draft +// playlist_items the toggle writes: +// (1) LIVE — tell every device on this playlist to silence the matching currently-playing +// item NOW (device matches by content_id/widget_id). Mutes the in-progress playthrough. +// (2) PERSIST — patch the matching item's `muted` inside the published_snapshot the device +// actually plays, then re-push the playlist. Without this the snapshot kept muted=0, so +// every loop/reload re-applied full volume — the "icon red but audio plays across 3 +// playthroughs" bug (Android re-loads each loop; web's native