🎯 Interactive Metadata Matching (BEETS-Inspired)
This release adds a powerful interactive metadata matching system inspired by BEETS, allowing you to search, score, and interactively select the best Audible metadata match for your M4B files.
✨ Highlights
- Interactive Matching Command - New
audiobook-forge matchcommand for intelligent metadata selection - Fuzzy Scoring System - Weighted distance algorithm (Title 40%, Author 30%, Duration 20%, Year 10%)
- Visual Confidence Levels - Color-coded matches (🟢 >96%, 🟡 88-96%, 🔴 80-88%)
- Rich Terminal UI - Beautiful interactive prompts using inquire crate
- Batch Processing - Process multiple M4B files with progress tracking
- Smart Extraction - Embedded tags + filename parsing with automatic fallback
🚀 New Features
Interactive Matching
# Interactive mode (default)
audiobook-forge match --file "Book.m4b"
# Batch processing
audiobook-forge match --dir /path/to/audiobooks
# Auto mode (non-interactive)
audiobook-forge match --dir /path --auto
# Dry run
audiobook-forge match --dir /path --dry-runMetadata Extraction
- Embedded M4B tags (mp4ameta) - primary source
- Filename parsing - "Author - Title.m4b" pattern
- Manual override via
--titleand--authorflags - Automatic merge strategies
Interactive UI Features
- Numbered candidate selection (1-10)
- Before/after metadata comparison
- Action menu: Skip, Manual Entry, Custom Search
- Confirmation dialog showing all changes
- Manual metadata entry form
- Custom search with new terms
📊 Match Scoring
Distance Calculation:
- Title: 40% weight (normalized Levenshtein distance)
- Author: 30% weight (best match from multiple authors)
- Duration: 20% weight (5% tolerance, >20% penalty)
- Year: 10% weight (±10 years tolerance)
Confidence Levels:
- 🟢 Strong: >96% match (distance < 0.04)
- 🟡 Medium: 88-96% match (distance < 0.12)
- 🔴 Low: 80-88% match (distance < 0.20)
- ⚪ None: <80% match
⚙️ Configuration
New match_mode setting in config.yaml:
metadata:
match_mode: disabled # Options: disabled, auto, interactivedisabled- Don't match during build (default)auto- Automatically select best matchinteractive- Prompt user for selection
📦 Dependencies
- inquire 0.6.2 - Interactive terminal UI
- strsim 0.10.0 - String similarity (normalized Levenshtein)
📈 Code Statistics
- 7 new files (~1,200 lines of code)
- 11 files modified
- Zero compilation errors
- Full async/await integration
🔧 Technical Details
Files Added:
src/models/match_models.rs- Match data structuressrc/utils/scoring.rs- Scoring enginesrc/utils/extraction.rs- Metadata extractionsrc/ui/mod.rs- UI modulesrc/ui/prompts.rs- Interactive prompts
Architecture:
File/Directory → Metadata Extraction → Audible Search →
Scoring & Ranking → Interactive Selection → Metadata Application
📝 Usage Examples
Interactive Matching:
audiobook-forge match --file "Book.m4b"Batch Processing:
audiobook-forge match --dir ~/audiobooks --region usAuto Mode:
audiobook-forge match --dir ~/audiobooks --autoManual Override:
audiobook-forge match --file "Book.m4b" \
--title "Project Hail Mary" \
--author "Andy Weir"⚠️ Known Limitations
- Audnexus API dependency (requires internet connection)
- API rate limiting (100 requests/minute)
- M4B files only (MP3 support planned)
🔮 Future Enhancements
- Build integration with match_mode config
- Support for MP3 files
- Custom scoring weights configuration
- Alternative metadata sources
📚 Documentation
- See CHANGELOG.md for full details
- See README.md for command reference
Full Changelog: v2.2.0...v2.3.0