diff --git a/beets/importer.py b/beets/importer.py index 94594a2a2..4af276abe 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -1365,8 +1365,13 @@ def user_query(session, task): user_query(session)) resolve_duplicates(session, task) + if task.should_merge_duplicates: + # Create a new task for tagging the current items + # and duplicates together duplicate_items = task.duplicate_items(session.lib) + + # duplicates would be reimported so make them look "fresh" _freshen_items(duplicate_items) duplicate_paths = [item.path for item in duplicate_items] diff --git a/docs/guides/tagger.rst b/docs/guides/tagger.rst index 4c9df42f8..db11dbcc6 100644 --- a/docs/guides/tagger.rst +++ b/docs/guides/tagger.rst @@ -234,17 +234,25 @@ If beets finds an album or item in your library that seems to be the same as the one you're importing, you may see a prompt like this:: This album is already in the library! - [S]kip new, Keep both, Remove old? + [S]kip new, Keep both, Remove old, Merge all? Beets wants to keep you safe from duplicates, which can be a real pain, so you -have three choices in this situation. You can skip importing the new music, +have four choices in this situation. You can skip importing the new music, choosing to keep the stuff you already have in your library; you can keep both -the old and the new music; or you can remove the existing music and choose the -new stuff. If you choose that last "trump" option, any duplicates will be +the old and the new music; you can remove the existing music and choose the +new stuff; or you can merge the newly imported album and existing duplicate +into one single album. +If you choose that "remove" option, any duplicates will be removed from your library database---and, if the corresponding files are located inside of your beets library directory, the files themselves will be deleted as well. +If you choose "merge", beets will try re-importing the existing and new tracks +as one bundle so they will get tagged together appropriately. +This is particularly helpful when you are importing extra tracks +of an album in your library with missing tracks, so beets will ask you the same +questions as it would if you were importing all tracks at once. + If you choose to keep two identically-named albums, beets can avoid storing both in the same directory. See :ref:`aunique` for details. diff --git a/docs/reference/config.rst b/docs/reference/config.rst index 9faddd2d2..ce45a94ee 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -571,11 +571,12 @@ Default: ``yes``. duplicate_action ~~~~~~~~~~~~~~~~ -Either ``skip``, ``keep``, ``remove``, or ``ask``. Controls how duplicates -are treated in import task. "skip" means that new item(album or track) will be -skipped; "keep" means keep both old and new items; "remove" means remove old -item; "ask" means the user should be prompted for the action each time. -The default is ``ask``. +Either ``skip``, ``keep``, ``remove``, ``merge`` or ``ask``. +Controls how duplicates are treated in import task. +"skip" means that new item(album or track) will be skipped; +"keep" means keep both old and new items; "remove" means remove old +item; "merge" means merge into one album; "ask" means the user +should be prompted for the action each time. The default is ``ask``. .. _bell: