fromfilename: Support 'track' prefix when parsing track number#6557
Merged
fromfilename: Support 'track' prefix when parsing track number#6557
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
PR make fromfilename plugin understand filename start with literal track before track number (like track01.m4a / track 2.m4a).
Changes:
- Extend
fromfilenamefilename regex to accept optionaltrackprefix before digits. - Add pytest coverage for
track01andtrack 2filename 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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
Contributor
|
This is a pretty small change but it looks good and would be useful for me! |
aereaux
approved these changes
Apr 20, 2026
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.
fromfilename: Support"track"prefix in track number parsingThe
fromfilenameplugin's filename-matching regex is extended to recognise filenames liketrack01.m4aortrack 2.m4a, where a literal"track"prefix precedes the track number.