From 100d2802797f1f3b0e1a1a6fd4b35a20d4306e39 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 4 Dec 2024 17:03:14 +0100 Subject: [PATCH 1/2] fix: add missing id field to subtitles --- src/types/resource/subtitles.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/resource/subtitles.rs b/src/types/resource/subtitles.rs index 150ce8380..91a147724 100644 --- a/src/types/resource/subtitles.rs +++ b/src/types/resource/subtitles.rs @@ -7,6 +7,7 @@ use url::Url; #[cfg_attr(test, derive(Derivative))] #[cfg_attr(test, derivative(Default))] pub struct Subtitles { + pub id: String, pub lang: String, #[cfg_attr( test, From 29383806f6522ba51ed0db31671246de8f2dc69a Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 4 Dec 2024 17:09:15 +0100 Subject: [PATCH 2/2] test: fix subtitles unit tests --- src/unit_tests/serde/default_tokens_ext.rs | 4 +++- src/unit_tests/serde/subtitles.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/unit_tests/serde/default_tokens_ext.rs b/src/unit_tests/serde/default_tokens_ext.rs index 3d22a9e47..b3462f6e9 100644 --- a/src/unit_tests/serde/default_tokens_ext.rs +++ b/src/unit_tests/serde/default_tokens_ext.rs @@ -56,8 +56,10 @@ impl DefaultTokens for Subtitles { vec![ Token::Struct { name: "Subtitles", - len: 2, + len: 3, }, + Token::Str("id"), + Token::Str(""), Token::Str("lang"), Token::Str(""), Token::Str("url"), diff --git a/src/unit_tests/serde/subtitles.rs b/src/unit_tests/serde/subtitles.rs index 576e8f0f1..a100d4c5a 100644 --- a/src/unit_tests/serde/subtitles.rs +++ b/src/unit_tests/serde/subtitles.rs @@ -6,14 +6,17 @@ use url::Url; fn subtitles() { assert_tokens( &Subtitles { + id: "id".to_owned(), lang: "lang".to_owned(), url: Url::parse("https://url").unwrap(), }, &[ Token::Struct { name: "Subtitles", - len: 2, + len: 3, }, + Token::Str("id"), + Token::Str("id"), Token::Str("lang"), Token::Str("lang"), Token::Str("url"),