Skip to content

Commit

Permalink
fix(stremio-core): StreamItemState - add default if fields are missin…
Browse files Browse the repository at this point in the history
…g as we skip serialization if they are None

Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Nov 14, 2024
1 parent 47059b1 commit 058c496
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/types/streams/streams_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ 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<SubtitleTrack>,
/// In milliseconds
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub subtitle_delay: Option<i64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
/// Subtitles size, platform dependent units
pub subtitle_size: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
/// Vertical offset of the subtitles, platform dependent units
pub subtitle_offset: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub audio_track: Option<AudioTrack>,
/// In milliseconds
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub audio_delay: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub playback_speed: Option<f32>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub player_type: Option<String>,
}

Expand Down

0 comments on commit 058c496

Please sign in to comment.