Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tvshow): make episode number nullable #84

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tvshow/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ mod integration_tests {
let secret = std::env::var("TMDB_TOKEN_V3").unwrap();
let client = Client::new(secret);

for i in 1..5 {
for i in [1, 2, 3, 4, 5, 81040] {
let result = TVShowDetails::new(i).execute(&client).await.unwrap();
assert_eq!(result.inner.id, i);
}
Expand Down
4 changes: 3 additions & 1 deletion src/tvshow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ pub struct TVShow {
pub last_episode_to_air: Option<EpisodeShort>,
pub next_episode_to_air: Option<EpisodeShort>,
pub networks: Vec<CompanyShort>,
pub number_of_episodes: u64,
/// Unlikely to be `None` but found with 81040.
/// In this case, could be computed by summing the `episodes_count` of the `seasons` field.
pub number_of_episodes: Option<u64>,
pub number_of_seasons: u64,
pub production_companies: Vec<CompanyShort>,
pub production_countries: Vec<Country>,
Expand Down
Loading