Repository navigation
Chapters: use file names when every file has the same title tag - #171
Open
NicolasHartmann wants to merge 1 commit into
Open
NicolasHartmann wants to merge 1 commit into
NicolasHartmann wants to merge 1 commit into
Conversation
…peat A multi-file audiobook gets one chapter per file without chapter marks, named after the file's title tag. When every file carries the same tag (often the book title), all entries in the chapter list looked identical. Those chapters now use the file name. Applied on import and when a book is loaded, so already imported books are covered too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A multi-file audiobook gets one chapter per file that has no chapter marks, and that chapter is named after the file's title tag. Many multi-file books carry the same title tag on every file (usually the book title), so the chapter list shows the same entry over and over:
It looks as if the names were cut off, but the stored titles really are identical (19 chapters, 1 distinct title in my library).
Fix
When the per-file chapters of a multi-file book cannot be told apart by their title tags (a tag is missing or repeated), they are named after their files instead:
The rule lives in
FileChapterTitles.Resolveand is applied in two places: on import (CreateAudiobookFromMultipleFiles) and in theAudiobookViewModelconstructor, so books that are already in the library show the right names without a re-import. The view model only changes the titles in memory; it does not write to the database by itself.Testing
FileChapterTitles.Resolve, butmainhas no test project yet (it arrives with Improve playback speed and mini-player controls #165), so they are not part of this PR. I can add them once a test project exists.🤖 Generated with Claude Code