fix: don't allow invalid search types

This commit is contained in:
metonym 2024-03-20 17:59:04 +01:00
parent b262ced09e
commit fe659ae88a
Signed by: metonym
GPG key ID: A9E0123EF1E9B34E

View file

@ -137,6 +137,11 @@ async fn download_torrent_files(args: Config) {
return;
}
if search_type != "anime" && search_type != "music" {
eprintln!("[ERROR] invalid search_type, please select `anime` or `music`");
return;
}
let filename_regex = Regex::new(r"Filename=.(?P<filename>.*).").unwrap();
let sleep_time = Duration::from_millis(100);