diff --git a/beetsplug/duplicates.py b/beetsplug/duplicates.py index 3da633116..23b476d19 100644 --- a/beetsplug/duplicates.py +++ b/beetsplug/duplicates.py @@ -17,7 +17,7 @@ import logging from beets.plugins import BeetsPlugin -from beets.ui import decargs, print_obj, Subcommand +from beets.ui import decargs, print_obj, vararg_callback, Subcommand PLUGIN = 'duplicates' log = logging.getLogger('beets') @@ -35,7 +35,7 @@ def _group_by(objs, keys): return counts -def _duplicates(objs, keys=['mb_trackid'], full=0): +def _duplicates(objs, keys, full): """Generate triples of MBIDs, duplicate counts, and constituent objects. """ @@ -55,7 +55,7 @@ class DuplicatesPlugin(BeetsPlugin): self.config.add({'count': False}) self.config.add({'album': False}) self.config.add({'full': False}) - self.config.add({'keys': ['mb_trackid']}) + self.config.add({'keys': ['mb_trackid', 'mb_albumid']}) self._command = Subcommand('duplicates', help=__doc__, diff --git a/docs/plugins/duplicates.rst b/docs/plugins/duplicates.rst index c344d50fc..1aee141f7 100644 --- a/docs/plugins/duplicates.rst +++ b/docs/plugins/duplicates.rst @@ -32,8 +32,8 @@ config file:: album: no full: no keys: - - mb_trackid - - album + - mb_trackid + - album or on the command-line:: @@ -82,9 +82,9 @@ keys The ``keys`` option (default: ``mb_trackid``) defines in which track or album fields duplicates are to be searched. By default, the plugin -only uses the musicbrainz track or album ID for this purpose. Using the -``keys`` option (as a YAML list in the configuration file, or a -comma-delimited string in the command-line), you can extend this behavior +uses the musicbrainz track and album IDs for this purpose. Using the +``keys`` option (as a YAML list in the configuration file, or as +space-delimited strings in the command-line), you can extend this behavior to consider other attributes. @@ -113,9 +113,9 @@ The same as the above but include the original album, and show the path:: beet duplicates -acf '$path' -Get rid of false positives arising from the same track existing in different albums:: +Get tracks with the same title, artist, and album:: - beet duplicates -k mb_trackid,album + beet duplicates -k title albumartist album TODO ----