From 9ae83a9118cacfa40c21a0e29b049c3a4540105f Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L. de Mello" Date: Tue, 2 Apr 2024 14:08:26 -0300 Subject: [PATCH] fix: npf media object format --- src/convert/npf.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/convert/npf.rs b/src/convert/npf.rs index 7107a5b..3ceb36c 100644 --- a/src/convert/npf.rs +++ b/src/convert/npf.rs @@ -249,7 +249,7 @@ pub mod content_types { pub url: Option, pub provider: Option, pub embed_html: Option, - pub embed_iframe: Option, + pub embed_iframe: Option, pub embed_url: Option, pub poster: Option>, pub filmstrip: Option>, @@ -323,11 +323,23 @@ pub mod objects { #[serde_with::skip_serializing_none] #[derive(Debug, Clone, Deserialize, Serialize)] pub struct Media { - pub r#type: String, + pub r#type: Option, pub url: String, - pub width: i32, - pub height: i32, + pub width: Option, + pub height: Option, pub poster: Option, + pub provider: Option, + pub original_dimensions_missing: Option, + pub cropped: Option, + pub has_original_dimensions: Option, + } + + #[serde_with::skip_serializing_none] + #[derive(Debug, Clone, Deserialize, Serialize)] + pub struct IFrame { + pub url: String, + pub width: Option, + pub height: Option, } #[serde_with::skip_serializing_none]