Skip to content

Commit

Permalink
Update return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
arogl committed May 9, 2024
1 parent cfbe634 commit 32007e4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,8 @@ def order_clause(self):
order = "ASC" if self.ascending else "DESC"
field = "albumartist" if self.album else "artist"
collate = "COLLATE NOCASE" if self.case_insensitive else ""
return (
"(CASE {0}_sort WHEN NULL THEN {0} "
"WHEN '' THEN {0} "
"ELSE {0}_sort END) {1} {2}"
).format(field, collate, order)

return f"COALESCE(NULLIF({field}_sort, ''), {field}) {collate} {order}"

def sort(self, objs):
if self.album:
Expand Down

0 comments on commit 32007e4

Please sign in to comment.