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-1174] Add an option to control the tolerance of track times difference #799
Conversation
@@ -427,7 +428,7 @@ def _update_tags(self): | |||
if not (files or tracks): | |||
return None | |||
|
|||
tag_diff = TagDiff() | |||
tag_diff = TagDiff(max_length_diff=config.setting["ignore_track_duration_difference_under"]) |
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.
Any reason to initialize the value here instead of just fetching it in the __init__
for TagDiff?
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.
Any reason to initialize the value here instead of just fetching it in the init for TagDiff?
I prefer to not link the class TagDiff to config options directly.
picard/ui/metadatabox.py
Outdated
|
||
def __init__(self): | ||
def __init__(self, max_length_diff=4): |
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.
Do we really need this to be a KW argument? Any reason why we are not just setting the value below at line 107 from config.setting ? It has a default value of 2, so it won't be undefined anytime?
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, if it is to be a KW argument, the default should probably be 2.
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.
Do we really need this to be a KW argument? Any reason why we are not just setting the value below at line 107 from config.setting ? It has a default value of 2, so it won't be undefined anytime?
I prefer to make this argument optional with a safe default.
Can you rebase the branch against master? |
70d11a5
to
53557af
Compare
Done, and fixed the default (2 vs 4). |
picard/ui/ui_options_advanced.py
Outdated
|
||
self.retranslateUi(AdvancedOptionsPage) | ||
QtCore.QMetaObject.connectSlotsByName(AdvancedOptionsPage) | ||
|
||
def retranslateUi(self, AdvancedOptionsPage): | ||
_translate = QtCore.QCoreApplication.translate | ||
self.groupBox.setTitle(_("Advanced options")) | ||
self.recursively_add_files.setText(_("Recursively add files and folders from directory")) | ||
self.label_track_duration_diff.setText(_("Ignore track duration difference under this number of seconds ")) |
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.
Remove trailing space?
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.
Remove trailing space?
Done, thanks for noticing it.
The option `ignore_track_duration_difference_under` can be set through Advanced options panel. If old and new Length tag have a difference under this value, they are considered equal, and this isn't accounted as a track difference.
Weird, you approved and this is still showing...
The option
ignore_track_duration_difference_under
can be set through Advanced options panel.If old and new Length tag have a difference under this value, they are considered equal, and this isn't accounted as a track difference.
The default value remains the same (2 seconds).
https://tickets.metabrainz.org/projects/PICARD/issues/PICARD-1174