fix: compare playlists, not durations, to detect a shifted enumeration #7

Merged
nugget merged 1 commit from fix/rip-disc-false-positive into main 2026-08-22 23:21:49 -05:00
Collaborator

The duration check I added in #5 aborted a correct rip. On a season 7 disc:

### WRONG TITLE t3: expected 3521s, got 3523s
###   scan title 3 = 00800.mpls | rip title 3 = 00800.mpls
###   scan enumerated 14 titles, this rip enumerated 14
### ABORTING: every remaining index is suspect.

Same playlist, same enumeration — which is to say the right title. The scan
reports whole seconds while ffprobe measures the muxed stream, and a couple of
seconds of disagreement is routine. Having aborted, it skipped the disc's two
remaining titles, which had to be ripped again.

Duration was the wrong signal to lead with. The playlist each index resolves
to is the ground truth: a shifted enumeration means index N mapped to a
different playlist than the scan recorded for it. That is now the abort
condition; a duration disagreement is merely noted.

Verification

Both real cases, replayed from their actual logs:

Case scan → rip titles verdict
S7D1 t3 — the correct rip it wrongly killed 00800.mpls00800.mpls 14 vs 14 accept
S5D4 t3 — the genuine divergence from #5 00800.mpls00304.mpls 29 vs 26 abort

So the check still catches the failure it was written for, and no longer fires
on measurement noise.

--tolerance now controls when a duration difference is reported rather than
when the run aborts, and defaults to 5s.

The duration check I added in #5 aborted a **correct** rip. On a season 7 disc: ``` ### WRONG TITLE t3: expected 3521s, got 3523s ### scan title 3 = 00800.mpls | rip title 3 = 00800.mpls ### scan enumerated 14 titles, this rip enumerated 14 ### ABORTING: every remaining index is suspect. ``` Same playlist, same enumeration — which is to say the right title. The scan reports whole seconds while `ffprobe` measures the muxed stream, and a couple of seconds of disagreement is routine. Having aborted, it skipped the disc's two remaining titles, which had to be ripped again. **Duration was the wrong signal to lead with.** The playlist each index resolves to is the ground truth: a shifted enumeration means index N mapped to a *different playlist* than the scan recorded for it. That is now the abort condition; a duration disagreement is merely noted. ### Verification Both real cases, replayed from their actual logs: | Case | scan → rip | titles | verdict | |---|---|---|---| | S7D1 t3 — the correct rip it wrongly killed | `00800.mpls` → `00800.mpls` | 14 vs 14 | **accept** | | S5D4 t3 — the genuine divergence from #5 | `00800.mpls` → `00304.mpls` | 29 vs 26 | **abort** | So the check still catches the failure it was written for, and no longer fires on measurement noise. `--tolerance` now controls when a duration difference is *reported* rather than when the run aborts, and defaults to 5s.
The duration check aborted a correct rip. On a season 7 disc it reported

    WRONG TITLE t3: expected 3521s, got 3523s
      scan title 3 = 00800.mpls | rip title 3 = 00800.mpls
      scan enumerated 14 titles, this rip enumerated 14

-- the same playlist under the same enumeration, which is to say the right
title. The scan reports whole seconds while ffprobe measures the muxed stream,
and roughly two seconds of disagreement is routine. Having aborted, it skipped
the disc's two remaining titles, which then had to be ripped again.

Duration was the wrong signal to lead with. The playlist each index resolves to
is the ground truth: a shifted enumeration means index N mapped to a DIFFERENT
playlist than the scan recorded. That is now the abort condition, and a
duration disagreement is merely noted.

Verified against both real cases: the season 7 rip is accepted (00800.mpls
both sides, 14 titles both sides), and the season 5 divergence still aborts
(00800.mpls vs 00304.mpls, 29 titles vs 26).
nugget merged commit eeeeb90644 into main 2026-08-22 23:21:49 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nugget/media-import-tooling!7
No description provided.