Skip to content

mam: do not file another series volume from an unsnatched row - #40

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-80e7
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-80e7

Conversation

@cursor

@cursor cursor Bot commented Oct 12, 2026

Copy link
Copy Markdown

Bug and impact

With mam/accept_unsnatched on, a series volume whose title does not write "Book N" (the number lives only in id3 SERIES/PART, or in a parsed folder such as Domagoj Kurmaic - Mother of Learning, Book 2) was accepted against another volume of the same title with a different MAM series_info part. The audio of book 1 could be filed as book 2.

samePosition already refused a title-written Book 2 against a part-3 row. It returned True whenever both titles lacked Book N, so the series parts were never compared.

Root cause

samePosition treated "neither title writes Book N" as no conflict. applyParsedName copies title/authors, not series/part, so a junk-tag file whose folder carried the volume still had nothing for samePosition to compare.

Fix

  • When neither title writes Book N but both books have a series part, require those parts to overlap.
  • In pickUnsnatched, apply the parsed folder part when the tags have none.
  • A row with no series_info is still accepted (cannot refuse the release's own torrent if MAM omitted the part).

Validation

  • GateTest.test_series_parts_must_agree_when_neither_title_writes_book_n: part 1 vs part 2 is refused; matching parts and 2/2.0 still accept.
  • GateTest.test_parsed_folder_part_is_used_when_id3_has_no_series_part: junk tags + Author - Title, Book 2 refuse MAM part 1/3 and accept part 2.
  • Existing Mother of Learning / Leviathan Wakes position tests still pass.
  • Full suite: 264 tests OK.
Open in Web View Automation 

samePosition treated two volumes as the same book whenever neither title
wrote "Book N", so a Mother of Learning part-1 file could be filed as
part 2 (id3 SERIES/PART or a parsed "Author - Title, Book 2" folder).
Compare those parts, and apply the parsed folder part when the tags
have none.

Co-authored-by: Mancolt <Mancolt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant