minor fixes and changelog entry

This commit is contained in:
Constantine Evans 2017-12-11 13:31:40 -08:00
parent c9b4e9b414
commit dd2b44ef20
2 changed files with 4 additions and 2 deletions

View file

@ -258,14 +258,14 @@ class DuplicatesPlugin(BeetsPlugin):
if tiebreak and kind in tiebreak.keys(): if tiebreak and kind in tiebreak.keys():
key = lambda x: tuple(getattr(x, k) for k in tiebreak[kind]) key = lambda x: tuple(getattr(x, k) for k in tiebreak[kind])
else: else:
if kind is 'items': if kind == 'items':
def truthy(v): def truthy(v):
# Avoid a Unicode warning by avoiding comparison # Avoid a Unicode warning by avoiding comparison
# between a bytes object and the empty Unicode # between a bytes object and the empty Unicode
# string ''. # string ''.
return v is not None and \ return v is not None and \
(v != '' if isinstance(v, six.text_type) else True) (v != '' if isinstance(v, six.text_type) else True)
fields = kind.all_keys() fields = Item.all_keys()
key = lambda x: sum(1 for f in fields if truthy(getattr(x, f))) key = lambda x: sum(1 for f in fields if truthy(getattr(x, f)))
else: else:
key = lambda x: len(x.items()) key = lambda x: len(x.items())

View file

@ -70,6 +70,8 @@ Fixes:
Python 3 on Windows with non-ASCII filenames. :bug:`2671` Python 3 on Windows with non-ASCII filenames. :bug:`2671`
* :doc:`/plugins/absubmit`: Fix an occasional crash on Python 3 when the AB * :doc:`/plugins/absubmit`: Fix an occasional crash on Python 3 when the AB
analysis tool produced non-ASCII metadata. :bug:`2673` analysis tool produced non-ASCII metadata. :bug:`2673`
* :doc:`/plugins/duplicates`: Use default tiebreak for any kind (item/album) that
does not have a tiebreak specified in the configuration.
* :doc:`/plugins/duplicates`: Fix the `--key` command line option, which was * :doc:`/plugins/duplicates`: Fix the `--key` command line option, which was
ignored. ignored.
* :doc:`/plugins/replaygain`: Fix album replaygain calculation with the * :doc:`/plugins/replaygain`: Fix album replaygain calculation with the