From 058c49674edccc6f37edc6b0a20a9b9de84806dd Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 14 Nov 2024 12:10:47 +0200 Subject: [PATCH] fix(stremio-core): StreamItemState - add default if fields are missing as we skip serialization if they are None Signed-off-by: Lachezar Lechev --- src/types/streams/streams_item.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/types/streams/streams_item.rs b/src/types/streams/streams_item.rs index 643a21610..9975edf17 100644 --- a/src/types/streams/streams_item.rs +++ b/src/types/streams/streams_item.rs @@ -27,10 +27,10 @@ pub struct StreamsItem { #[derive(Default, Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct StreamItemState { - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub subtitle_track: Option, /// In milliseconds - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub subtitle_delay: Option, #[serde(default, skip_serializing_if = "Option::is_none")] /// Subtitles size, platform dependent units @@ -38,14 +38,14 @@ pub struct StreamItemState { #[serde(default, skip_serializing_if = "Option::is_none")] /// Vertical offset of the subtitles, platform dependent units pub subtitle_offset: Option, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub audio_track: Option, /// In milliseconds - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub audio_delay: Option, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub playback_speed: Option, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub player_type: Option, }