diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/src/bin/import.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/src/bin/import.rs b/tools/src/bin/import.rs index 28151e4..863e107 100644 --- a/tools/src/bin/import.rs +++ b/tools/src/bin/import.rs @@ -71,8 +71,8 @@ fn main() -> anyhow::Result<()> { let id = if let Some(id) = id { id.parse().unwrap() } else { - let title = title.unwrap(); - let results = tmdb_search(kind, &title, &key)?; + let title = title.as_ref().unwrap(); + let results = tmdb_search(kind, title, &key)?; info!("results:"); for (i, r) in results.results.iter().enumerate() { info!( @@ -120,9 +120,11 @@ fn main() -> anyhow::Result<()> { }) .transpose()?; - info!("is this correct? [y/n]"); - if stdin().lines().next().unwrap().unwrap() != "y" { - exit(0) + if title.is_some() { + info!("is this correct? [y/n]"); + if stdin().lines().next().unwrap().unwrap() != "y" { + exit(0) + } } let kind; |