diff --git a/beets/config_default.yaml b/beets/config_default.yaml index 4c12c3df07..fa77a82dc5 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -23,6 +23,7 @@ import: group_albums: no pretend: false search_ids: [] + duplicate_action: ask clutter: ["Thumbs.DB", ".DS_Store"] ignore: [".*", "*~", "System Volume Information", "lost+found"] diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 75cae066c8..2a51af7aad 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -824,11 +824,19 @@ def resolve_duplicate(self, task, found_duplicates): log.warn(u"This {0} is already in the library!", (u"album" if task.is_album else u"item")) + # If set, get the action to follow from config. + sel = config['import']['duplicate_action'].as_choice({ + u'skip': u's', + u'keep': u'k', + u'remove': u'r', + u'ask': None, + }) + if config['import']['quiet']: # In quiet mode, don't prompt -- just skip. log.info(u'Skipping.') sel = u's' - else: + elif sel is None: # Print some detail about the existing and new items so the # user can make an informed decision. for duplicate in found_duplicates: