1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
pub mod details;
pub mod search;
use crate::common::country::Country;
use crate::common::language::Language;
use crate::company::CompanyShort;
use crate::genre::Genre;
use crate::people::PersonShort;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TVShowBase {
pub id: u64,
pub name: String,
pub original_name: String,
pub original_language: String,
pub origin_country: Vec<String>,
pub overview: String,
#[serde(with = "crate::util::date")]
pub first_air_date: chrono::NaiveDate,
pub poster_path: Option<String>,
pub backdrop_path: Option<String>,
pub popularity: f64,
pub vote_count: u64,
pub vote_average: f64,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TVShowShort {
#[serde(flatten)]
pub inner: TVShowBase,
pub genre_ids: Vec<u64>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct EpisodeShort {
#[serde(with = "crate::util::date")]
pub air_date: chrono::NaiveDate,
pub episode_number: u64,
pub id: u64,
pub name: String,
pub overview: String,
pub production_code: String,
pub season_number: u64,
pub still_path: Option<String>,
pub vote_average: f64,
pub vote_count: u64,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SeasonShort {
#[serde(with = "crate::util::optional_date")]
pub air_date: Option<chrono::NaiveDate>,
pub episode_count: u64,
pub id: u64,
pub name: String,
#[serde(deserialize_with = "crate::util::empty_string::deserialize")]
pub overview: Option<String>,
pub poster_path: Option<String>,
pub season_number: u64,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct TVShow {
#[serde(flatten)]
pub inner: TVShowBase,
pub created_by: Vec<PersonShort>,
pub episode_run_time: Vec<u64>,
pub genres: Vec<Genre>,
pub homepage: String,
pub in_production: bool,
pub languages: Vec<String>,
#[serde(with = "crate::util::optional_date")]
pub last_air_date: Option<chrono::NaiveDate>,
pub last_episode_to_air: Option<EpisodeShort>,
pub next_episode_to_air: Option<EpisodeShort>,
pub networks: Vec<CompanyShort>,
pub number_of_episodes: u64,
pub number_of_seasons: u64,
pub production_companies: Vec<CompanyShort>,
pub production_countries: Vec<Country>,
pub seasons: Vec<SeasonShort>,
pub spoken_languages: Vec<Language>,
pub status: String,
#[serde(deserialize_with = "crate::util::empty_string::deserialize")]
pub tagline: Option<String>,
#[serde(rename = "type")]
pub ttype: String,
}