mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-25 19:58:36 -06:00
fix: Remember choice if cancelled by user
This commit is contained in:
parent
8b6e83a55a
commit
591ae8f796
1 changed files with 6 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
use inquire::{
|
||||
ui::{Color, IndexPrefix, RenderConfig, Styled},
|
||||
Select,
|
||||
InquireError, Select,
|
||||
};
|
||||
use std::{collections::HashMap, fs, path::Path, process::exit};
|
||||
use tmdb_api::{
|
||||
|
@ -137,7 +137,11 @@ pub async fn process_file(
|
|||
Ok(movie) => movie,
|
||||
Err(error) => {
|
||||
println!(" {error}");
|
||||
return (filename_without_ext, "".to_string(), false);
|
||||
let flag = matches!(
|
||||
error,
|
||||
InquireError::OperationCanceled | InquireError::OperationInterrupted
|
||||
);
|
||||
return (filename_without_ext, "".to_string(), flag);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue