Skip to content
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

Merged
merged 1 commit into from Jan 18, 2018

Conversation

zas
Copy link
Collaborator

@zas zas commented Jan 18, 2018

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

@zas zas requested a review from samj1912 January 18, 2018 10:17
@@ -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"])
Copy link
Collaborator

@samj1912 samj1912 Jan 18, 2018

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?

Copy link
Collaborator Author

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.


def __init__(self):
def __init__(self, max_length_diff=4):
Copy link
Collaborator

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?

Copy link

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.

Copy link
Collaborator Author

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.

@samj1912
Copy link
Collaborator

Can you rebase the branch against master?

@zas zas force-pushed the PICARD-1174 branch 2 times, most recently from 70d11a5 to 53557af Compare January 18, 2018 11:04
@zas
Copy link
Collaborator Author

zas commented Jan 18, 2018

Can you rebase the branch against master?

Done, and fixed the default (2 vs 4).


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 "))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing space?

Copy link
Collaborator Author

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.
@zas zas dismissed samj1912’s stale review January 18, 2018 13:30

Weird, you approved and this is still showing...

@zas zas merged commit cbb8685 into metabrainz:master Jan 18, 2018
@zas zas deleted the PICARD-1174 branch January 18, 2018 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants