mirror of
https://github.com/beetbox/beets.git
synced 2025-12-10 02:22:25 +01:00
only use tiebreak if tiebreak includes an entry for the kind being considered, otherwise use default (eg, if only items is specified, and -a is being used, use default order of priority
This commit is contained in:
parent
d932aa4f5c
commit
c9b4e9b414
1 changed files with 4 additions and 5 deletions
|
|
@ -253,13 +253,12 @@ class DuplicatesPlugin(BeetsPlugin):
|
|||
"completeness" (objects with more non-null fields come first)
|
||||
and Albums are ordered by their track count.
|
||||
"""
|
||||
if tiebreak:
|
||||
kind = 'items' if all(isinstance(o, Item)
|
||||
for o in objs) else 'albums'
|
||||
kind = 'items' if all(isinstance(o, Item) for o in objs) else 'albums'
|
||||
|
||||
if tiebreak and kind in tiebreak.keys():
|
||||
key = lambda x: tuple(getattr(x, k) for k in tiebreak[kind])
|
||||
else:
|
||||
kind = Item if all(isinstance(o, Item) for o in objs) else Album
|
||||
if kind is Item:
|
||||
if kind is 'items':
|
||||
def truthy(v):
|
||||
# Avoid a Unicode warning by avoiding comparison
|
||||
# between a bytes object and the empty Unicode
|
||||
|
|
|
|||
Loading…
Reference in a new issue