-
-
Notifications
You must be signed in to change notification settings - Fork 384
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-2729: Allow disabling date sanitization for APE and Vorbis tags #2406
base: master
Are you sure you want to change the base?
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.
Also tests have to be fixed.
ae91763
to
4e75f53
Compare
Also a reminder that the documentation will need to be updated once this is merged. |
Perhaps this is a dumb question, but would there ever be a case where you might want to only apply this to one of the formats? If so, would it make sense to have separate settings for APE and Vorbis? |
Actually we could have an option that isn't a boolean, but rather a list of formats, so we can apply this to any chosen format instead. Something like |
Added PICARD-2862 to update the documentation. |
@ShubhamBhut what do you think about suggested approach? |
I understood it, except that there are only 3 tags vorbis, mp3/id3 and APE which uses sanitize_date so I think it would be implemented for only these 3 tags ? Also apologies for late update, it's just that I have been tightly occupied for last couple of days. I will implement it tomorrow. |
I'd add a method to those classes that wraps from picard.util import sanitize_date
class APEv2File(File):
sanitize_date = sanitize_date
....
if name == 'year':
name = 'date'
value = self.sanitize_date(value) In formats/util.py we need to add a method returning all known format classes having this method: def formats_with_sanitize_date():
for fmt in _formats:
if hasattr(fmt, 'sanitize_date'):
yield fmt In selector code, you can iterate those classes: from picard.formats.util import formats_with_sanitize_date
for fmt in formats_with_sanitize_date():
do_something_with(fmt) Totally untested, but you get the idea I guess. |
4e75f53
to
a00cb79
Compare
51aaa38
to
e82dc4c
Compare
Hey @zas, actually this is not complete yet. For some reason, the marked formats of multicombobox are not saved. I have yet to figure it out :( |
See ShubhamBhut#1
|
aa252cf
to
5d9f57c
Compare
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.
It looks much better.
BTW, you shouldn't rebase all the time,Rebasing is useful, but commit history is too.
You didn't merge my PR?
picard/ui/ui_options_metadata.py
Outdated
# Automatically generated - do not edit. | ||
# Use `python setup.py build_ui` to update it. | ||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is | ||
# run again. Do not edit this file unless you know what you are doing. |
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.
This file has to be generated by running python setup.py build_ui
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.
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
is to be manually added, right ? running python setup.py build_ui
doesn't seem to add that
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.
Nope, but there was a bug that was recently fixed, be sure to rebase your PR onto the latest master
5d9f57c
to
21eaa85
Compare
Apologies, I will keep that in mind. Actually I was using jujutsu for version control and it doesn't have pre-commit hooks support yet. I will stick to vanilla git from now on. |
21eaa85
to
3097455
Compare
3097455
to
5d5546e
Compare
@ShubhamBhut what's the status of this PR? |
Summary
Problem
Solution
Added a new config setting which is checked before sanitizing date for Vorbis and APE types. Config setting can be changed by a checkbox added in Metadata section of the Options
Action
Similar as Solution