From 00679fc78d8578f0dfc82cd6192a004fc82243fd Mon Sep 17 00:00:00 2001 From: Fabio Waljaard Date: Sat, 14 Dec 2024 22:28:53 +0100 Subject: [PATCH] Fix 'play' command requiring 'offset' field (#1418) * Fix 'play' command requiring 'offset' field * Derive 'Default' for SkipTo --- CHANGELOG.md | 1 + connect/src/spirc.rs | 2 +- core/src/dealer/protocol/request.rs | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb13097c..b2611eb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index b9240851..e3892866 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -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, diff --git a/core/src/dealer/protocol/request.rs b/core/src/dealer/protocol/request.rs index 4d796469..67992437 100644 --- a/core/src/dealer/protocol/request.rs +++ b/core/src/dealer/protocol/request.rs @@ -170,7 +170,7 @@ pub struct TransferOptions { #[derive(Clone, Debug, Deserialize)] pub struct PlayOptions { - pub skip_to: SkipTo, + pub skip_to: Option, #[serde(default, deserialize_with = "option_json_proto")] pub player_options_override: Option, pub license: Option, @@ -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, pub track_uri: Option,