diff --git a/beets/importer.py b/beets/importer.py index 82f60da4b..e8e5334a8 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -308,6 +308,7 @@ class ImportTask(object): self.path = path self.items = items self.sentinel = False + self.remove_duplicates = False @classmethod def done_sentinel(cls, toppath): diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 9f77b5826..865afb55e 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -570,7 +570,21 @@ def resolve_duplicate(task, config): """ log.warn("This %s is already in the library!" % ("album" if task.is_album else "item")) - task.set_choice(importer.action.SKIP) + sel = ui.input_options( + ('Skip new', 'Keep both', 'Remove old'), + color=config.color + ) + if sel == 's': + # Skip new. + task.set_choice(importer.action.SKIP) + elif sel == 'k': + # Keep both. Do nothing; leave the choice intact. + pass + elif sel == 'r': + # Remove old. + task.remove_duplictes = True + else: + assert False # The import command.