diff --git a/picard/metadata.py b/picard/metadata.py index 8fe0f7ff57..0e42f13b96 100644 --- a/picard/metadata.py +++ b/picard/metadata.py @@ -369,6 +369,12 @@ def compare_to_track(self, track, weights): score = self.length_score(a, b) parts.append((score, weights["length"])) + if 'isvideo' in weights: + metadata_is_video = self['~video'] == '1' + track_is_video = track.get('video', False) + score = 1 if metadata_is_video == track_is_video else 0 + parts.append((score, weights['isvideo'])) + if "releases" in track: releases = track['releases'] @@ -377,12 +383,6 @@ def compare_to_track(self, track, weights): sim = linear_combination_of_weights(parts) * search_score return SimMatchTrack(similarity=sim, releasegroup=None, release=None, track=track) - if 'isvideo' in weights: - metadata_is_video = self['~video'] == '1' - track_is_video = track.get('video', False) - score = 1 if metadata_is_video == track_is_video else 0 - parts.append((score, weights['isvideo'])) - result = SimMatchTrack(similarity=-1, releasegroup=None, release=None, track=None) for release in releases: release_parts = self.compare_to_release_parts(release, weights)