-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PICARD-3000: Children's Music is shown as "Children'S Music" in Picard #2548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this patch. For this use case it should work. But I wonder if we should use a better function to begin with.
There is an existing title case function as scripting at https://github.com/metabrainz/picard/blob/master/picard/script/functions.py#L964
I think we should factor out the title casing functionality into a function in picard.util
, e.g. just def titlecase(s)
. Then this function can be used both here for handling the genres and in the func_title
scripting function.
This also allows to add tests for the title case function.
Thank you for looking into it. I think that would be best way to do it. If we use this approach should I create another separate PR for handling that? |
@zytact Would be allright to do this as part of this PR |
Use titlecase util function instead of string title method
Create titlecase util function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix & code improvement, LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this contribution. Looks great. Just the initial titlize function added to track.py can now be removed. Then this is good to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM
Summary
Problem
Genre
Children's Music
is shown asChildren'S Music
using Python's title method.Solution
Create a custom function to handle making the genre title case which also handles the apostrophe.