Skip to content

fix: exclude nav playlists from specials, add disc2/3/6/7 test coverage#18

Merged
yxbh merged 6 commits intomainfrom
test/disc2-expectations
Feb 27, 2026
Merged

fix: exclude nav playlists from specials, add disc2/3/6/7 test coverage#18
yxbh merged 6 commits intomainfrom
test/disc2-expectations

Conversation

@yxbh
Copy link
Owner

@yxbh yxbh commented Feb 27, 2026

Summary

Fix navigation playlists being incorrectly classified as special features, add disc7 fixture from a two-episode OVA disc, strengthen test expectations across disc2/3/6/7, and ensure all fixture disc titles use generic names per copyright guidelines.

Background

Disc2 and disc3 have short navigation playlists (00000.mpls used as disc intro) referenced by first_playback/top_menu movie objects. These were incorrectly detected as special features by the classification fallback path. Additionally, several discs lacked test coverage for episode counts, scene breakdowns, special feature expectations, and disc title extraction.

Changes

Bug fix

  • bdpl/analyze/__init__.py: Add _nav_playlists_from_hints() helper that identifies playlists used by first_playback/top_menu movie objects; exclude them in _special_features_from_classifications()

Disc7 fixture (new)

  • tests/fixtures/disc7/: Two-episode OVA disc (vol 2 of box set) — 7 MPLS, 10 CLPI, index.bdmv, MovieObject.bdmv, META/DL/bdmt_eng.xml
  • tests/test_disc7_scan.py: Integration tests — episode count/ordering, scene counts (4 each), durations, special count (2 stream variants), disc title, play-all classification
  • tests/conftest.py: Add disc7_path and disc7_analysis fixtures

Test coverage improvements

  • tests/test_disc2_scan.py: Add test_no_special_features and test_disc_title
  • tests/test_disc3_scan.py: Add test_disc3_no_special_features
  • tests/test_disc6_scan.py: Add test_disc6_disc_title, improve docstring documenting 2-episode structure
  • tests/test_disc_matrix.py: Add disc2, disc3, disc7 to specials matrix; add disc7 to all matrices; add disc_title extraction matrix

Fixture cleanup

  • tests/fixtures/disc2/META/DL/bdmt_eng.xml: New, generic title
  • tests/fixtures/disc6/META/DL/bdmt_eng.xml: Replaced copyrighted title with generic
  • tests/fixtures/disc7/META/DL/bdmt_eng.xml: New, generic title

Testing

  • ruff check . — all checks passed
  • pytest -q — 154 tests passed
  • All existing disc1/disc4/disc5/disc6 test expectations unchanged

Additional Notes

  • Disc7 specials: 2 (not 3) — playlists 00005 and 00006 are TrueHD vs AC-3 stream variants of the same clip; dedup picks one as representative
  • Disc7 ep1 scenes: 4 (not 3) — the 4th scene is a short ~3.6min credits tail that the chapter analysis detects as a separate section
  • All bdmt_eng.xml titles are generic (e.g. 'TEST DISC 2') per AGENTS.md copyright fixture guidelines

yxbh and others added 3 commits February 27, 2026 20:17
…verage

Playlists referenced by first_playback or top_menu movie objects are
navigation content (disc intro, menu background), not special features.
Exclude them from classification-based special detection.

- Add _nav_playlists_from_hints() to identify first_playback/top_menu
  playlists and filter them in _special_features_from_classifications()
- Add disc2 META/DL/bdmt_eng.xml fixture for disc title extraction
- Add disc2 tests: no specials, disc title matches expected value
- Add disc2 to specials visibility matrix (0 total, 0 visible)
- Add disc_title extraction matrix test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add test_disc3_no_special_features to test_disc3_scan.py
- Add disc3 to specials visibility matrix (0 total, 0 visible)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add disc6 META/DL/bdmt_eng.xml fixture for disc title extraction
- Add test_disc6_disc_title assertion
- Add disc6 to disc_title extraction matrix
- Document disc6 structure in module docstring: 2 unique episodes
  (clip 00006 x4 stream variants + clip 00007), 3 specials are
  the remaining audio/subtitle variants

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yxbh yxbh force-pushed the test/disc2-expectations branch from 3cb8733 to 3238f73 Compare February 27, 2026 10:39
yxbh and others added 2 commits February 27, 2026 20:41
Per AGENTS.md fixture guidelines: do not include disc titles or other
identifying information that ties fixtures to specific copyrighted works.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add disc7 fixture from a two-episode OVA disc (vol 2 of box set):
- 2 episodes: ep1 (59min, 4 scenes), ep2 (60min, 4 scenes)
- 2 specials: stream variants of same clip (TrueHD vs AC-3)
- Play-all playlist (00002.mpls) with both episodes + outro
- Generic disc title via META/DL/bdmt_eng.xml

Tests: episode count, ordering, scene counts, durations,
special count/durations, disc title, play-all classification.
Matrix entries for episodes, specials, segments, chapter-split, title.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yxbh yxbh changed the title fix: exclude nav playlists from specials, add disc2/disc3 test coverage fix: exclude nav playlists from specials, add disc2/3/6/7 test coverage Feb 27, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yxbh yxbh merged commit 6ecf092 into main Feb 27, 2026
1 check passed
@yxbh yxbh deleted the test/disc2-expectations branch February 27, 2026 10:57
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