picard icon indicating copy to clipboard operation
picard copied to clipboard

PICARD-3084: Allow up to 3 chars for Windows file name compatibility replacements

Open jpauwels opened this issue 7 months ago • 3 comments

Summary

  • This is a…
    • [] Bug fix
    • [x] Feature addition
    • [ ] Refactoring
    • [ ] Minor / simple change (like a typo)
    • [ ] Other
  • Describe this change in 1-2 sentences: Allow up to 3 chars for Windows file name compatibility replacements.

Problem

Only allowing one-for-one replacements of problematic characters on Windows limits the flexibility in rewriting file names. Concretely, I'd like to replace a colon with a dash with additional whitespace, such that "Title: Subtitle" becomes "Title - Subtitle" instead of "Title- Subtitle".

Solution

Adapt the regex conformity check to allow up to three characters replacement for a single problematic character.

Action

Additional actions required:

  • [ ] Update Picard documentation (please include a reference to this PR)
  • [ ] Other (please specify below)

jpauwels avatar May 03 '25 14:05 jpauwels

As this is a functional change that needs to be added to the changelog we also need a ticket on https://tickets.metabrainz.org/ before we can merge this.

phw avatar May 04 '25 13:05 phw

I added PICARD-3084 to track this. But the PR still needs more work before it is mergeable. The UI must be adjusted to allow more characters as well.

phw avatar Jun 18 '25 05:06 phw

I'm not against this change, but couldn't the desired behavior be produced using a tagger script? Something like:

$set(_new_title,$rreplace($replace(%title%,:, - ),\\s+, ))

and then use %_new_title% in the file naming script instead of %title%?

rdswift avatar Jun 21 '25 14:06 rdswift