grouping: do not merge different books that both use 64k/ - #22
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
#20 walked past MP3/ but treated Title/64k/ and Title/MP3/64k/ as the release, so two downloads that both used a bitrate folder were keyed as "64k" and hardlinked to the first match. Walk past BITRATE_FOLDER always. Filing also walks past codec/bitrate wrappers under a disc so cd1/MP3/64k/ and cd2/MP3/64k/ get distinct subfolders. Co-authored-by: Mancolt <Mancolt@users.noreply.github.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.
Bug and impact
#20 walked past
MP3/but treatedTitle/64k/andTitle/MP3/64k/as the release. Two downloads that both use a bitrate folder were keyed as64kand hardlinked to the first match — the same class of merge as #15 (cd1/) and #20 (MP3/).cd1/MP3/64k/01.mp3andcd2/MP3/64k/01.mp3also filed into one flatAuthor/Title/folder, so the second disc was silently skipped.Root cause
groupingNameonly skipped disc folders and codec names (mp3,m4b, …). A64k//128kbps/quality folder is the immediate parent of the files on many MAM rips, so it became the grouping key. Filing only walked up one codec level, so a bitrate wrapper undercd1/MP3/hid the disc.Fix
Walk past bitrate folders (
64k,128kbps,128 kbps, …) the same way codec folders are already skipped. Filing walks past codec and bitrate wrappers to find the disc parent.Validation
64k//MP3/64k/, and forcd1/MP3/64kvscd2/MP3/64kgetting distinct targetspython3 -m unittest discover -s tests: 205 tests, OK