1

Functionify

This commit is contained in:
Kim Wittenburg
2018-09-04 13:23:18 +02:00
parent 613c6504d2
commit 50af43b895

View File

@@ -344,10 +344,7 @@ class iTunesPlugin(BeetsPlugin):
if self.method in ['lookup', 'lookup (search fallback)']: if self.method in ['lookup', 'lookup (search fallback)']:
choices += [PromptChoice('c', 'searCh iTunes', self.prompt_search)] choices += [PromptChoice('c', 'searCh iTunes', self.prompt_search)]
no_itunes_matches = 0 no_itunes_matches = len(list(filter(lambda match: match.info.data_source == 'iTunes', task.candidates)))
for match in task.candidates:
if match.info.data_source == 'iTunes':
no_itunes_matches += 1
if no_itunes_matches == 1 and task.candidates[0].info.data_source == 'iTunes': if no_itunes_matches == 1 and task.candidates[0].info.data_source == 'iTunes':
print_(colorize('text_highlight', 'This is the only iTunes Match')) print_(colorize('text_highlight', 'This is the only iTunes Match'))