Initial commit

This commit is contained in:
Connor Johnstone
2026-03-17 14:32:52 -04:00
commit 884acfcd18
10 changed files with 832 additions and 0 deletions

36
readme.md Normal file
View File

@@ -0,0 +1,36 @@
# shanty-index
Music file indexing and metadata extraction for [Shanty](ssh://connor@git.rcjohnstone.com:2222/Shanty/shanty.git).
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
```sh
# 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
```rust
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}");
```