-
Notifications
You must be signed in to change notification settings - Fork 695
Re-Add ability to handle/play tracks #1468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request re-adds track handling/play capabilities that were previously removed, restoring support for the uris field in the play API. The changes span multiple modules, updating context conversion, play command handling, load request models, and context resetting logic.
- Updated protocol conversions for context pages and tracks.
- Modified SpircTask to support play commands with both URI and tracks.
- Refactored load request models and context reset behaviors.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
protocol/src/impl_trait/context.rs | Added From implementations for Vec and Vec for ContextPage. |
connect/src/spirc.rs | Updated play command handling to support PlayContext with URI or tracks and adjusted context resolution logic. |
connect/src/model.rs | Switched LoadRequest to use the new PlayContext enum and added a helper for track URIs. |
connect/src/state/restrictions.rs | Modified the restrictions clearing mechanism to assign default values. |
connect/src/state/context.rs | Updated context reset logic to clear context_uri and context_url, along with minor refactorings. |
Comments suppressed due to low confidence (2)
connect/src/spirc.rs:1100
- When 'load_from_context_uri' is true, the resolve context is added twice (once conditionally and again unconditionally). Consider removing one of the duplicate calls to avoid potential redundant context resolution.
self.context_resolver.add(ResolveContext::from_uri(ctx_uri.clone(), &fallback, ContextType::Default, ContextAction::Replace,));
connect/src/model.rs:23
- [nitpick] The variant 'Tracks' in PlayContext may be ambiguous. Consider renaming it to 'TrackUris' for improved clarity.
pub(super) enum PlayContext {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. A couple of code suggestions.
@roderickvd Friendly bump to check over the last changes? |
Just looked through the changes again and didn't find a changelog entry. I think the reasoning behind that was because the requesting was changed completely, and that is already stated in the changelog. As this just adds something new to the mentioned struct in the changelog no entry is required.
|
Re-Adds the ability that was removed by the dealer rework to handle/play tracks.
Fixes #1097 (as the
uris
field via theplay
api will be supported again)