Functionify
This commit is contained in:
@@ -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'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user