From 0d8d1c3aee6059cf0085ef955100f29130b3fda0 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 1 Nov 2017 19:13:42 -0400 Subject: [PATCH] Modify task recommendation and candidates This way, subsequent candidates can be exposed to plugins instead of just used locally to interact with the user. --- beets/ui/commands.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index a4b433925..133057b05 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -691,7 +691,6 @@ class TerminalImportSession(importer.ImportSession): return action # Loop until we have a choice. - candidates, rec = task.candidates, task.rec while True: # Ask for a choice from the user. The result of # `choose_candidate` may be an `importer.action`, an @@ -699,8 +698,8 @@ class TerminalImportSession(importer.ImportSession): # `PromptChoice`. choices = self._get_choices(task) choice = choose_candidate( - candidates, False, rec, task.cur_artist, task.cur_album, - itemcount=len(task.items), choices=choices + task.candidates, False, task.rec, task.cur_artist, + task.cur_album, itemcount=len(task.items), choices=choices ) # Basic choices that require no more action here. @@ -716,8 +715,8 @@ class TerminalImportSession(importer.ImportSession): return post_choice elif isinstance(post_choice, autotag.Proposal): # Use the new candidates and continue around the loop. - candidates = post_choice.candidates - rec = post_choice.recommendation + task.candidates = post_choice.candidates + task.rec = post_choice.recommendation # Otherwise, we have a specific match selection. else: