Open nopoz opened 5 years ago
It looks like we actually changed the behaviour of title
from doing what you asked here to doing what it does now in #3033 and #3059, as previously it would convert strings such as "Don't" to "Don'T". I'm not sure what the right thing to do here is, as reading this it seems like we should maybe consider switching back to the old functionality but maintain a whitelist or blacklist of characters that should/shouldn't appear before characters that are going to be capitalised.
Maybe we can learn from this project: https://github.com/ppannuto/python-titlecase (at least the test cases could be useful inspiration).
Interesting find! It's clear that our title-case function could be improved, but I don't think we should switch back to the old version (just .title()
), since it's also imperfect. I'm marking this as a feature request to make title-casing more robust and standard.
Created a pull request for this issue: https://github.com/beetbox/beets/pull/3411
Using the
%title
Title Case function in the path, it looks like characters that are preceded by a non-alpha are not changed.For example:
The Album Title
Childish Gambino - 2016 - “awaken, My Love!”
where%title{$album%aunique{}}
is defined in the default path. The "a" in awaken is preceded by a quote character.Another example, the track name
08 - Bow Shock (interlude).mp3
where$track - %title{$title}
is defined.Not sure if this is a known issue or not? Any workarounds if known?
Thanks!
Snippet from my config.yaml if it's helpful: