Skip to content

Commit

Permalink
Merge pull request #747 from Stremio/fix/subtitles-id
Browse files Browse the repository at this point in the history
fix: add missing id field to subtitles
  • Loading branch information
elpiel authored Dec 4, 2024
2 parents 9e3abdf + 2938380 commit 6fb40de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/types/resource/subtitles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion src/unit_tests/serde/default_tokens_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
5 changes: 4 additions & 1 deletion src/unit_tests/serde/subtitles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 6fb40de

Please sign in to comment.