Skip to content

Commit

Permalink
Fix 'play' command requiring 'offset' field (#1418)
Browse files Browse the repository at this point in the history
* Fix 'play' command requiring 'offset' field

* Derive 'Default' for SkipTo
  • Loading branch information
FabioGNR authored Dec 14, 2024
1 parent 72b6ad9 commit 00679fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
on Android platform.
- [core] Fix "Invalid Credentials" when using a Keymaster access token and
client ID on Android platform.
= [connect] Fix "play" command not handled if missing "offset" property

### Removed

Expand Down
2 changes: 1 addition & 1 deletion connect/src/spirc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ impl SpircTask {
context_uri: play.context.uri.clone(),
start_playing: true,
seek_to: play.options.seek_to.unwrap_or_default(),
playing_track: play.options.skip_to.into(),
playing_track: play.options.skip_to.unwrap_or_default().into(),
shuffle,
repeat,
repeat_track,
Expand Down
4 changes: 2 additions & 2 deletions core/src/dealer/protocol/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub struct TransferOptions {

#[derive(Clone, Debug, Deserialize)]
pub struct PlayOptions {
pub skip_to: SkipTo,
pub skip_to: Option<SkipTo>,
#[serde(default, deserialize_with = "option_json_proto")]
pub player_options_override: Option<ContextPlayerOptionOverrides>,
pub license: Option<String>,
Expand All @@ -191,7 +191,7 @@ pub struct OptionsOptions {
system_initiated: bool,
}

#[derive(Clone, Debug, Deserialize)]
#[derive(Clone, Debug, Deserialize, Default)]
pub struct SkipTo {
pub track_uid: Option<String>,
pub track_uri: Option<String>,
Expand Down

0 comments on commit 00679fc

Please sign in to comment.