Commit dc32ed3
committed
feat: add Sonos favorites playlists support
Add support for browsing and playing Sonos favorite playlists/albums directly from the TUI.
Features:
- Fetch and display favorite playlists from Sonos speakers
- Two-view interface: Queue (1) and Favorites (2)
- Navigate favorites with arrow keys (up/down or j/k)
- Play favorites by pressing Enter
- Support for various playlist types including YouTube Music
- Optimized state updates with caching to prevent UI hangs
- Batch command processing to improve responsiveness
Implementation details:
- Added FavoritePlaylist struct to represent Sonos favorites
- Implemented ContentDirectory browsing via UPnP actions
- Added ViewMode enum for switching between Queue and Favorites views
- Enhanced SpeakerState with favorites list and navigation state
- Improved command handling with batching and state caching
- Added proper XML parsing for Sonos playlist metadata
Technical notes:
- Uses Arc<TrackInfo> and Arc<Vec<Track>> for efficient state sharing
since sonor crate types don't implement Clone. Arc allows cheap cloning
via reference counting instead of expensive data duplication on every
state update (which happens every second).1 parent 8e3e487 commit dc32ed3
3 files changed
Lines changed: 428 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
| |||
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
| |||
0 commit comments