Use album as title for chaptered m4b files - #86
Open
cjonesde wants to merge 1 commit into
Open
Conversation
getID3 copies every ©nam atom into comments['title']. Chaptered m4b files
carry one per chapter, so title[0] is a chapter name ("Opening Credits")
rather than the work's title.
Prefer album, which is not chapterised. Failing that use the last entry:
the work's own ©nam is in moov/udta, parsed after the chapter tracks.
Scoped to quicktime tags, so files carrying both ID3v1 and ID3v2 titles
are unaffected. Both fixtures are synthetic: ffmpeg silence with ©nam
atoms injected.
Fixes ben-xo#81
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.
Fixes #81.
getID3 copies every
©namatom intocomments['title']. Chaptered m4b files carry one per chapter, sotitle[0]is a chapter name such as "Opening Credits" rather than the work's title.Measured on an 810-episode library: affected files carried 17 and 18
©namatoms, matching their chapter counts. Unaffected files carry exactly one. This is why the reporter in #81 saw "End Credits", and it is independent of thechplchapter list.Fix
Prefer
album, which is not chapterised. Failing that, take the last entry rather than the first: the work's own©namis inmoov/udta, which is parsed after the chapter tracks.Scoped to quicktime-tagged files, so anything carrying both ID3v1 and ID3v2 titles is untouched.
Tests
Two fixtures, with and without an album tag. Both are synthetic (ffmpeg silence with
©namatoms injected), so no third-party audio is added to the repo. 1113 and 1080 bytes.1068 tests pass, up from 1062. The new tests also run under the Caching and AUTO_SAVE_COVER subclasses.
Verified against the 810-episode library: a full re-parse produces byte-identical output to a local patch that has been in production there.