Skip to content

Fix filtered MusicBrainz track totals - #6887

Draft
iamdhrv wants to merge 1 commit into
beetbox:masterfrom
iamdhrv:agent/consistent-ignored-tracks
Draft

Fix filtered MusicBrainz track totals#6887
iamdhrv wants to merge 1 commit into
beetbox:masterfrom
iamdhrv:agent/consistent-ignored-tracks

Conversation

@iamdhrv

@iamdhrv iamdhrv commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Change

  • derive each MusicBrainz track's medium_total from the tracks remaining after
    data/video filtering
  • extend the existing data/video matrix to assert the reported medium total for
    every configuration

Why

Video tracks live in MusicBrainz's normal track list, so filtering them left
medium_total at the original unfiltered count. Data tracks are represented
separately, which produced inconsistent metadata for the two equivalent ignore
options. Reporting the filtered count keeps the candidate's per-medium metadata
consistent with the tracks Beets actually imports.

Checks

  • uv run ruff check beetsplug/musicbrainz.py test/plugins/test_musicbrainz.py
  • uv run pytest -q test/plugins/test_musicbrainz.py (55 passed)

Fixes #6836

Signed-off-by: Dhruv Maniya <dhruvmaniya1998@gmail.com>
@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@github-actions github-actions Bot added the musicbrainz musicbrainz plugin label Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.62%. Comparing base (12e261c) to head (d408476).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6887   +/-   ##
=======================================
  Coverage   75.62%   75.62%           
=======================================
  Files         163      163           
  Lines       21318    21318           
  Branches     3361     3361           
=======================================
  Hits        16122    16122           
  Misses       4405     4405           
  Partials      791      791           
Files with missing lines Coverage Δ
beetsplug/musicbrainz.py 95.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@snejus snejus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

musicbrainz musicbrainz plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent import behavior between ignore_data_tracks and ignore_video_tracks

2 participants