feat: add Sonos favorites playlists support#150
Merged
abusch merged 1 commit intoabusch:mainfrom Nov 30, 2025
Merged
Conversation
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).
abusch
approved these changes
Nov 30, 2025
Owner
abusch
left a comment
There was a problem hiding this comment.
Hi, thanks for the PR! This little definitely needs a bit of love... one thing I'd like to do is to use subscriptions/events instead of polling for the state all the time, and maybe switch to wez-sonos instead of sonor as it seems much more complete.
But given I don't know when/if I'll do all that, I'm happy to merge this for now :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for browsing and playing Sonos favorite playlists/albums directly from the TUI.
Features:
Implementation details:
Technical notes:
Hi! Thank you for creating this awesome project and lay a solid foundation.
I understand that this PR makes some product decisions (like the two-view interface and keyboard
shortcuts), and I'm completely open to suggestions or changes if you'd like things done differently.
I'd like to have a snappy TUI experience for controlling my Sonos speakers and therefore I found this
project
I'd love to see this merged if it aligns with your vision for the project, but also totally happy to
maintain it as a personal fork if you prefer to keep full control over the direction. Either way works for
me.