918 B
918 B
shanty-index
Music file indexing and metadata extraction for Shanty.
Scans a directory tree, extracts embedded metadata (ID3, Vorbis comments, MP4 tags, etc.)
using lofty, and upserts everything into the Shanty database. Supports incremental
re-indexing via file modification time tracking.
Usage
# Scan a directory
shanty-index /path/to/music
# Dry run (no DB writes)
shanty-index /path/to/music --dry-run -vv
# Custom database location
shanty-index /path/to/music --database sqlite:///path/to/shanty.db?mode=rwc
As a library
use shanty_index::{ScanConfig, run_scan};
use shanty_db::Database;
let db = Database::new("sqlite::memory:").await?;
let config = ScanConfig {
root: "/path/to/music".into(),
dry_run: false,
concurrency: 4,
};
let stats = run_scan(db.conn(), &config).await?;
println!("{stats}");