commit 328ffa576ef9923de7a0229535e50ec0bf9685ec
parent a6546430e05fb631e2d609102cf5c8aabc6b96de
Author: mtmn <miro@haravara.org>
Date: Wed, 6 May 2026 02:29:49 +0200
feat: rename `--write`, rustfmt, cargo.lock
Diffstat:
5 files changed, 12 insertions(+), 96 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -138,7 +138,7 @@ dependencies = [
"ffmpeg-sys-next",
"log",
"ndarray 0.16.1",
- "ndarray-stats 0.6.0",
+ "ndarray-stats",
"noisy_float",
"rcue",
"rustfft",
@@ -268,7 +268,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51"
dependencies = [
"clap_builder",
- "clap_derive",
]
[[package]]
@@ -284,18 +283,6 @@ dependencies = [
]
[[package]]
-name = "clap_derive"
-version = "4.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9"
-dependencies = [
- "heck",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "clap_lex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -308,18 +295,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
[[package]]
-name = "console"
-version = "0.16.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87"
-dependencies = [
- "encode_unicode",
- "libc",
- "unicode-width",
- "windows-sys",
-]
-
-[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -435,12 +410,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
-name = "encode_unicode"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
-
-[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -615,19 +584,6 @@ dependencies = [
]
[[package]]
-name = "indicatif"
-version = "0.18.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb"
-dependencies = [
- "console",
- "portable-atomic",
- "unicode-width",
- "unit-prefix",
- "web-time",
-]
-
-[[package]]
name = "is-terminal"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -823,21 +779,6 @@ dependencies = [
]
[[package]]
-name = "ndarray-stats"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b6e54a8b65764f71827a90ca1d56965ec0c67f069f996477bd493402a901d1f"
-dependencies = [
- "indexmap",
- "itertools 0.13.0",
- "ndarray 0.17.2",
- "noisy_float",
- "num-integer",
- "num-traits",
- "rand",
-]
-
-[[package]]
name = "noisy_float"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1315,18 +1256,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]]
-name = "unicode-width"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
-
-[[package]]
-name = "unit-prefix"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3"
-
-[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1348,11 +1277,8 @@ dependencies = [
"chrono",
"clap",
"csv",
- "indicatif",
"lofty",
"ndarray 0.17.2",
- "ndarray-stats 0.7.0",
- "noisy_float",
"rayon",
"serde",
"walkdir",
@@ -1439,16 +1365,6 @@ dependencies = [
]
[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
name = "winapi-util"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/README.md b/README.md
@@ -28,7 +28,7 @@ cargo build --release
### Options
-* `-w`, `--write-tags`: Write detected BPM and Key to audio file metadata.
+* `-w`, `--write`: Write detected BPM and Key to audio file metadata.
* `-f`, `--force`: Re-analyze files even if they already have BPM/Key tags.
* `-j`, `--jobs <JOBS>`: Number of threads to use (0 = all cores).
* `-r`, `--report`: Generate a CSV report with timestamped filename.
@@ -42,10 +42,10 @@ cargo build --release
./target/release/virittaa /path/to/track.mp3
# Analyze a directory and write metadata tags
-./target/release/virittaa --write-tags /path/to/music/
+./target/release/virittaa --write /path/to/music/
# Re-analyze files that already have tags
-./target/release/virittaa --force --write-tags /path/to/music/
+./target/release/virittaa --force --write /path/to/music/
# Limit to 4 threads
./target/release/virittaa -j 4 /path/to/music/
diff --git a/src/audio_processing.rs b/src/audio_processing.rs
@@ -1,12 +1,12 @@
+use crate::constants::{
+ BPM_HOP_SIZE, BPM_MAX, BPM_MIN, BPM_OFFSET, BPM_WINDOW_SIZE, CHROMA_BINS, KEY_HOP_SIZE,
+ KEY_WINDOW_SIZE, SAMPLE_RATE, TUNING_PRECISION,
+};
use anyhow::Result;
use bliss_audio::chroma::bench::{chroma_stft, estimate_tuning};
use bliss_audio::utils::bench::stft;
use bliss_audio_aubio_rs::{OnsetMode, Tempo};
use ndarray::Array1;
-use crate::constants::{
- SAMPLE_RATE, BPM_HOP_SIZE, BPM_MAX, BPM_MIN, BPM_OFFSET, BPM_WINDOW_SIZE, CHROMA_BINS,
- KEY_HOP_SIZE, KEY_WINDOW_SIZE, TUNING_PRECISION,
-};
/// Calculate the BPM of a track.
///
diff --git a/src/file_io.rs b/src/file_io.rs
@@ -9,8 +9,8 @@ use std::path::Path;
use crate::audio_processing::{calculate_bpm, calculate_key};
use crate::types::{TrackError, TrackInfo};
-use bliss_audio::decoder::ffmpeg::FFmpegDecoder as Decoder;
use bliss_audio::decoder::Decoder as DecoderTrait;
+use bliss_audio::decoder::ffmpeg::FFmpegDecoder as Decoder;
#[derive(Debug, Default)]
pub struct FileMetadata {
diff --git a/src/main.rs b/src/main.rs
@@ -28,9 +28,9 @@ fn main() -> Result<()> {
.version(clap::crate_version!())
.arg(Arg::new("path").required(true).num_args(1..))
.arg(
- Arg::new("write-tags")
+ Arg::new("write")
.short('w')
- .long("write-tags")
+ .long("write")
.action(clap::ArgAction::SetTrue)
.help("Write BPM and Key to file metadata"),
)
@@ -58,7 +58,7 @@ fn main() -> Result<()> {
)
.get_matches();
- let write_tags = matches.get_flag("write-tags");
+ let write_tags = matches.get_flag("write");
let force = matches.get_flag("force");
let jobs = *matches.get_one::<usize>("jobs").unwrap();
let generate_report = matches.get_flag("report");