Skip to content

Commit c9b4e9b

Browse files
committed
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
1 parent d932aa4 commit c9b4e9b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

beetsplug/duplicates.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,12 @@ def _order(self, objs, tiebreak=None):
253253
"completeness" (objects with more non-null fields come first)
254254
and Albums are ordered by their track count.
255255
"""
256-
if tiebreak:
257-
kind = 'items' if all(isinstance(o, Item)
258-
for o in objs) else 'albums'
256+
kind = 'items' if all(isinstance(o, Item) for o in objs) else 'albums'
257+
258+
if tiebreak and kind in tiebreak.keys():
259259
key = lambda x: tuple(getattr(x, k) for k in tiebreak[kind])
260260
else:
261-
kind = Item if all(isinstance(o, Item) for o in objs) else Album
262-
if kind is Item:
261+
if kind is 'items':
263262
def truthy(v):
264263
# Avoid a Unicode warning by avoiding comparison
265264
# between a bytes object and the empty Unicode

0 commit comments

Comments
 (0)