Conversation
Replace brittle hard-coded thresholds with multi-signal approaches that combine structural evidence from disc navigation with shape heuristics. Chapter-split detection (ordering.py): - Accept optional ig_chapter_marks from IG menu buttons - Require est_count >= 3 OR IG mark confirmation for splitting - Prevents single ~50min movies from being split into 2 episodes Digital archive detection (classify.py): - Three independent signals lower the item-count floor: 1. Item count >= 20 (strong shape, sufficient alone) 2. Title hint from disc navigation (lowers floor to 5) 3. No audio streams in play items (lowers floor to 5) - All combined with base shape checks (avg <= 0.5s, unique ratio >= 0.8) Analysis pipeline fixes (__init__.py): - Pass IG chapter marks through to order_episodes() - Compute title_hint_mpls set from hints for classify_playlists() - Fix variant collapse to check clip overlap before collapsing - Skip commentary detection on navigation pages with mixed targets - Normalize ch_start=0 to None for digital_archive dedup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Five new Blu-ray disc fixtures covering chapter-split episodes, OVA specials, digital archives, and single-movie discs: - disc15: 4 chapter-split episodes, no specials (similar to disc14) - disc16: 4 chapter-split episodes + 4 specials (2 extras, 2 creditless EDs) - disc17: 1 OVA episode + 1 digital archive (44 still-image items) - disc18: 1 movie + 2 specials (1 extra, 1 creditless ED) - disc19: 1 OVA episode + 1 digital archive (17 items, hint-backed) Each fixture contains only structural metadata (MPLS, CLPI, index.bdmv, MovieObject.bdmv, ICS menu data, generic disc title XML). No copyrighted media content is included. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per-disc integration tests for each new fixture: - test_disc15_scan.py: chapter-split, 4 episodes, no specials - test_disc16_scan.py: chapter-split, 4 episodes, 4 specials - test_disc17_scan.py: single OVA + digital archive (44 items) - test_disc18_scan.py: single movie + 2 specials - test_disc19_scan.py: single OVA + hint-backed digital archive (17 items) Updated conftest.py with session-scoped path and analysis fixtures. Updated all 6 parametrizations in test_disc_matrix.py. Test count: 307 -> 321, all passing. Co-authored-by: Copilot <223556219+Copilot@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.
Summary
Add five new Blu-ray disc test fixtures (disc15–19) covering chapter-split episodes, OVA specials, digital archives, and single-movie discs. Replace brittle hard-coded thresholds in the analysis pipeline with multi-signal approaches that combine structural evidence from disc navigation with shape heuristics. Test count increases from 307 to 321, all passing.
Background
While adding fixtures from the "08th MS Team" Blu-ray set, several analysis bugs were uncovered where heuristics used single arbitrary thresholds that failed on new disc patterns. This PR fixes those bugs and replaces the thresholds with principled multi-signal detection that combines structural evidence (IG chapter marks, title hints, audio stream metadata) with shape heuristics.
Changes
Analysis pipeline fixes (
bdpl/analyze/__init__.py)_maybe_collapse_variant_episodes()now checks clip overlap before collapsing — prevents unrelated duplicate specials from triggering episode collapsech_start=0→Nonefordigital_archivecategory so IG-derived and title-hint entries deduplicateorder_episodes()and title-hint MPLS set toclassify_playlists()Chapter-split detection (
bdpl/analyze/ordering.py)_episodes_from_chapters()accepts optionalig_chapter_marksparameterest_count >= 3(strong duration signal)Digital archive detection (
bdpl/analyze/classify.py)Three independent signals, any of which lowers the item-count floor from 20 to 5 when combined with base shape checks (avg ≤ 0.5s, unique ratio ≥ 0.8):
New fixtures (
tests/fixtures/disc15–19/)Test infrastructure
Testing
ruff check .— all checks passedruff format --check .— 58 files already formattedpytest tests/ -q— 321 passed in ~2sAdditional Notes