diff options
author | metamuffin <metamuffin@disroot.org> | 2023-08-01 20:32:35 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-08-01 20:32:35 +0200 |
commit | ff9060ea0987e29e4d468ff7c9fed7cc7109bf2b (patch) | |
tree | fc8c7ad11ca2dfc7ebccb65ea9ea3c27827405dd /tools/src/bin | |
parent | f7992589cf45c699599a7ee5fc4634c9db16ff87 (diff) | |
download | jellything-ff9060ea0987e29e4d468ff7c9fed7cc7109bf2b.tar jellything-ff9060ea0987e29e4d468ff7c9fed7cc7109bf2b.tar.bz2 jellything-ff9060ea0987e29e4d468ff7c9fed7cc7109bf2b.tar.zst |
federation possible but inconvinient
Diffstat (limited to 'tools/src/bin')
-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; |