tmdb_cli/libs/models/movies.rs
1use chrono::prelude::*;
2use serde::Deserialize;
3
4use super::{Genre, ProductionCompany, ProductionCountry, Language};
5
6/// Details from searching for [`Movie`] by name
7#[derive(Deserialize, Debug)]
8pub struct Movie {
9 /// The path to the poster for this movie
10 pub poster_path: Option<String>,
11 /// Whether this is an adult movie or not
12 pub adult: bool,
13 /// A brief overview of this Movie
14 pub overview: String,
15 /// When this movie was released
16 pub release_date: NaiveDate,
17 /// The genre IDs for this movie
18 #[serde(default)]
19 pub genre_ids: Vec<i64>,
20 /// The id for this movie
21 pub id: i64,
22 /// The original title for this movie
23 pub original_title: String,
24 /// The original language for this movie
25 pub original_lnguage: Option<String>,
26 /// The title of this movie
27 pub title: String,
28 /// The path to the backdrop for this movie
29 pub backdrop_path: Option<String>,
30 /// The popularity of this movie
31 pub popularity: f64,
32 /// The number of votes for this movie
33 pub vote_count: u64,
34 /// Whether this is not a movie but another type of longer video
35 pub video: bool,
36 /// The average vote for this movie
37 pub vote_average: f64
38}
39
40/// A cursor from a movie search
41#[derive(Deserialize, Debug)]
42pub struct MovieList {
43 /// What page in the search this cursor is for
44 pub page: u64,
45 /// The movies found
46 pub results: Vec<Movie>,
47 /// The total number of results found with this search
48 pub total_results: u64,
49 /// The total number of pages found with this search
50 pub total_pages: u64,
51}
52
53/// Details on a Movies
54#[derive(Deserialize, Debug)]
55pub struct MovieDetails {
56 /// Whether this movie is an adult movie or not
57 pub adult: bool,
58 /// The path the backdrop for this movie can be found at
59 pub backdrop_path: Option<String>,
60 /// Whether this movie belongs to a collection or not
61 pub belongs_to_collection: Option<bool>,
62 /// The budget for this movie
63 pub budget: i64,
64 // The list of genres this movie is apart of
65 pub genres: Vec<Genre>,
66 /// The homepage for this Movie
67 pub homepage: Option<String>,
68 /// The id for this movie
69 pub id: i64,
70 /// The imdb ID for this movie
71 pub imdb_id: Option<String>,
72 /// The Original language this was in
73 pub original_language: String,
74 /// The original title fo this movie
75 pub original_title: String,
76 /// An overview for this movie
77 pub overview: Option<String>,
78 /// The popularity of this movie
79 pub popularity: f64,
80 /// The path to the poster for this movie
81 pub poster_path: Option<String>,
82 /// The production companies involved in making this movie
83 pub production_companies: Vec<ProductionCompany>,
84 /// The countries this movie was produced in
85 pub production_countries: Vec<ProductionCountry>,
86 /// When this movie was released
87 pub release_date: NaiveDate,
88 /// How much this movie made in revenue
89 pub revenue: i64,
90 /// The total runtime of this movie in minutes
91 pub runtime: Option<i64>,
92 /// The languages spoken in this movie
93 pub spoken_languages: Vec<Language>,
94 /// The current status of this movie
95 pub status: String,
96 /// The tag line or slogan for this movie
97 pub tagline: Option<String>,
98 /// The title of this movie
99 pub title: String,
100 /// Whether this is not a movie but another type of longer video
101 pub video: bool,
102 /// The average vote for this movie
103 pub vote_average: f64,
104 /// The number of votes for this movie
105 pub vote_count: i64,
106}