Skip to content

fromfilename: Support 'track' prefix when parsing track number#6557

Merged
snejus merged 1 commit intomasterfrom
fromfilename-support-track-prefix
Apr 20, 2026
Merged

fromfilename: Support 'track' prefix when parsing track number#6557
snejus merged 1 commit intomasterfrom
fromfilename-support-track-prefix

Conversation

@snejus
Copy link
Copy Markdown
Member

@snejus snejus commented Apr 20, 2026

fromfilename: Support "track" prefix in track number parsing

The fromfilename plugin's filename-matching regex is extended to recognise filenames like track01.m4a or track 2.m4a, where a literal "track" prefix precedes the track number.

Copilot AI review requested due to automatic review settings April 20, 2026 15:10
@snejus snejus requested a review from a team as a code owner April 20, 2026 15:10
@github-actions github-actions Bot added the fromfilename fromfilename plugin label Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

PR make fromfilename plugin understand filename start with literal track before track number (like track01.m4a / track 2.m4a).

Changes:

  • Extend fromfilename filename regex to accept optional track prefix before digits.
  • Add pytest coverage for track01 and track 2 filename cases.
  • Add changelog entry for new parsing behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
beetsplug/fromfilename.py Update track-only regex to allow optional track prefix before number.
test/plugins/test_fromfilename.py Add tests for track01.m4a and track 2.m4a parsing.
docs/changelog.rst Document new track-prefix support in Unreleased features.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.85%. Comparing base (44ffbdf) to head (2698044).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6557   +/-   ##
=======================================
  Coverage   71.85%   71.85%           
=======================================
  Files         156      156           
  Lines       20181    20181           
  Branches     3211     3211           
=======================================
  Hits        14501    14501           
  Misses       5001     5001           
  Partials      679      679           
Files with missing lines Coverage Δ
beetsplug/fromfilename.py 92.64% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aereaux
Copy link
Copy Markdown
Contributor

aereaux commented Apr 20, 2026

This is a pretty small change but it looks good and would be useful for me!

@snejus snejus enabled auto-merge April 20, 2026 15:15
@snejus snejus merged commit c9cee0d into master Apr 20, 2026
25 checks passed
@snejus snejus deleted the fromfilename-support-track-prefix branch April 20, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fromfilename fromfilename plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants