feat(remote): sync shuffle/repeat between desktop and PWA

- Add shuffle/repeat fields to PlaybackEvent struct
- Emit queue:state event when shuffle/repeat changes via API
- Add queue event listener in desktop frontend
- Include shuffle/repeat in WebSocket broadcasts
- PWA updates shuffle/repeat from WebSocket messages

This enables bidirectional sync: changes from PWA update desktop UI,
and changes from desktop update PWA via WebSocket.
This commit is contained in:
vicrodh committed 2026-02-03 09:22:55 -06:00
1 parent 6b85086b0a
commit 477258d94a
5 files changed
+90 -3

No files matched your search

+6
View File
@@ -489,6 +489,10 @@ pub struct PlaybackEvent {
pub sample_rate: Option<u32>,
/// Actual bit depth of the current stream
pub bit_depth: Option<u32>,
/// Queue shuffle state
pub shuffle: Option<bool>,
/// Queue repeat mode ("off", "all", "one")
pub repeat: Option<String>,
}
/// Shared state between main thread and audio thread
@@ -2012,6 +2016,8 @@ impl Player {
volume: self.state.volume(),
sample_rate: if sample_rate > 0 { Some(sample_rate) } else { None },
bit_depth: if bit_depth > 0 { Some(bit_depth) } else { None },
shuffle: None, // Set by caller with access to queue state
repeat: None, // Set by caller with access to queue state
}
}
}