🎯 What's New
Replace generic chapter names ("Chapter 1", "Chapter 2") with meaningful titles from multiple sources!
✨ New Features
Chapter Update System
- Fetch chapters from Audnex API by ASIN
- Parse chapters from text files (simple, timestamped, MP4Box formats)
- Extract chapters from EPUB table of contents
- Read existing chapters from M4B files using ffprobe
Chapter Merge Strategies
keep-timestamps: Update names while preserving existing timestampsreplace-all: Replace entire chapter listskip-on-mismatch: Error if chapter counts don't matchinteractive: Prompt for each file (default)
CLI Enhancements
Extended metadata enrich command with:
--chapters <FILE>: Import from text/EPUB file--chapters-asin <ASIN>: Fetch from Audnex API--update-chapters-only: Skip metadata, only update chapters--merge-strategy <STRATEGY>: Choose merge approach
Build Integration
- New config:
metadata.audible.fetch_chapters(default: false) - Automatic chapter fetching during
--fetch-audible
📖 Usage Examples
# Update from Audnex API
audiobook-forge metadata enrich --file book.m4b --chapters-asin B08V3XQ7LK
# Update from text file
audiobook-forge metadata enrich --file book.m4b --chapters chapters.txt
# Update from EPUB
audiobook-forge metadata enrich --file book.m4b --chapters book.epub
# Chapters only (skip metadata)
audiobook-forge metadata enrich --file book.m4b \
--chapters chapters.txt --update-chapters-only🛠️ Technical Details
- New Models:
AudibleChapter,AudnexChaptersResponse,ChapterSource,ChapterMergeStrategy - New Functions:
parse_text_chapters(),parse_epub_chapters(),merge_chapters(),read_m4b_chapters() - Tests: 8 comprehensive integration tests + 14+ unit tests
- Dependencies: Added
epub = "2.0" - Files Modified: 11 files, ~1200 lines added
💬 Community Driven
This feature was implemented based on Reddit community feedback addressing the common issue of M4B files with generic chapter names. Thank you for the suggestion!
📦 Installation
cargo install audiobook-forgeFor detailed documentation, see the README.