Initial commit
This commit is contained in:
36
readme.md
Normal file
36
readme.md
Normal 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}");
|
||||
```
|
||||
Reference in New Issue
Block a user