diff options
Diffstat (limited to 'tools/src')
-rw-r--r-- | tools/src/bin/import.rs | 10 | ||||
-rw-r--r-- | tools/src/tmdb.rs | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/tools/src/bin/import.rs b/tools/src/bin/import.rs index 08b88a4..b70c347 100644 --- a/tools/src/bin/import.rs +++ b/tools/src/bin/import.rs @@ -29,7 +29,6 @@ struct Args { enum Action { Create { path: PathBuf, - #[arg(short, long)] title: Option<String>, #[arg(short = 'T', long)] tmdb: Option<String>, @@ -76,7 +75,12 @@ fn main() -> anyhow::Result<()> { let results = tmdb_search(&title, &key)?; info!("results:"); for (i, r) in results.results.iter().enumerate() { - info!("\t[{i}] {}: {}", r.id, r.title); + info!( + "\t[{i}] {}: {} ({})", + r.id, + r.title, + r.overview.chars().take(100).collect::<String>() + ); } let res_index = if results.results.len() != 1 { stdin() @@ -120,7 +124,7 @@ fn main() -> anyhow::Result<()> { poster, backdrop, description: details.overview, - description_head: details.tagline, + description_head: details.tagline.unwrap_or_default(), title: details.title, duration: Default::default(), tracks: Default::default(), diff --git a/tools/src/tmdb.rs b/tools/src/tmdb.rs index c17adab..d451a95 100644 --- a/tools/src/tmdb.rs +++ b/tools/src/tmdb.rs @@ -14,14 +14,14 @@ pub struct TmdbQuery { #[derive(Debug, Clone, Deserialize)] pub struct TmdbQueryResult { pub adult: bool, - pub backdrop_path: String, + pub backdrop_path: Option<String>, pub genre_ids: Vec<u64>, pub id: u64, pub original_language: String, pub original_title: String, pub overview: String, pub popularity: f64, - pub poster_path: String, + pub poster_path: Option<String>, pub release_date: String, pub title: String, pub video: bool, @@ -46,11 +46,11 @@ pub struct TmdbDetails { pub vote_average: f64, pub vote_count: usize, pub budget: usize, - pub homepage: String, - pub imdb_id: String, + pub homepage: Option<String>, + pub imdb_id: Option<String>, pub production_companies: Vec<TmdbProductionCompany>, pub revenue: usize, - pub tagline: String, + pub tagline: Option<String>, } #[derive(Debug, Clone, Deserialize)] |