mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
Add slow sort to SmartArtistSort
This commit is contained in:
parent
f9c6dd6d67
commit
f5e1846ff0
1 changed files with 7 additions and 0 deletions
|
|
@ -163,6 +163,13 @@ class SmartArtistSort(dbcore.query.Sort):
|
|||
'WHEN "" THEN {0} '
|
||||
'ELSE {0}_sort END) {1}').format(field, order)
|
||||
|
||||
def sort(self, objs):
|
||||
if 'albumartist' in self.model_cls._fields:
|
||||
key = lambda a: a.albumartist_sort or a.albumartist
|
||||
else:
|
||||
key = lambda i: i.artist_sort or i.artist
|
||||
return sorted(objs, key=key)
|
||||
|
||||
|
||||
# Special path format key.
|
||||
PF_KEY_DEFAULT = 'default'
|
||||
|
|
|
|||
Loading…
Reference in a new issue