diff options
| author | jakka <jakkadoujin@gmail.com> | 2025-06-19 00:33:52 +0300 |
|---|---|---|
| committer | jakka <jakkadoujin@gmail.com> | 2025-06-19 00:33:52 +0300 |
| commit | eb838afe24b3f33d8dff88d570574aeea8060f15 (patch) | |
| tree | 144e2d61e16eb02b3b314fdd376c6afabfb467b7 /src/main.rs | |
| parent | 6d9e1300a2769fe4c0f4b290122143f52fc7a3ef (diff) | |
rewrote flac logic. added (non-working) batch reencoding test. added reencode status update on reencoding
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs index d660f0a..5d3835f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,14 +16,6 @@ fn build_cli() -> Command { .value_parser(value_parser!(PathBuf)), ) .arg( - Arg::new("index") - .short('i') - .long("index") - .help("Only index files") - .requires("path") - .action(ArgAction::SetTrue), - ) - .arg( Arg::new("doit") .long("doit") .help("Actually reencode files") @@ -97,13 +89,13 @@ fn main() -> Result<()> { }; let path = args.get_one::<PathBuf>("path"); - if !args.get_flag("index") && !args.get_flag("clean") && !args.get_flag("doit") { - let count = files::count_reencode_files(&conn, path).await.unwrap(); + if path.is_none() && !args.get_flag("clean") && !args.get_flag("doit") { + let count = files::count_reencode_files(path, &conn).await.unwrap(); println!("Files to reencode:\t{count}"); - } - - if args.get_flag("index") { - files::index_files_recursively(path.unwrap(), &conn).await?; + } else if let Some(realpath) = path { + if !args.get_flag("doit") { + files::index_files_recursively(realpath, &conn).await?; + } } if args.get_flag("clean") { @@ -111,7 +103,7 @@ fn main() -> Result<()> { } if args.get_flag("doit") { - files::reencode_files(&conn, path).await?; + files::reencode_files(path, &conn).await?; } Ok::<(), anyhow::Error>(()) })?; |
