You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original issue 1352 created by danielkza2 on 2014-03-20T03:11:09.000Z:
Quodlibet version: 3.0.99 from Fedora 20 unstable repo.
Albums with a total rating of 0.0 (I noticed because I have lots of unrated albums and set the default rating to 0) sort before everything else in the Album List browser.
This is caused by a mistake in the sorting function in quodlibet/browsers/albums/main.py:
def __compare_rating(self, model, i2, i1, data):
a1, a2 = model.get_value(i1, 0), model.get_value(i2, 0)
if (a1 and a2) is None:
return cmp(a1, a2)
return (cmpa(a1("~#rating"), a2("~#rating")) or
cmpa(a1.date, a2.date) or
cmpa(a1.sort, a2.sort) or
cmp(a1.key, a2.key))
Notice the use of cmpa for the rating: it causes the 'falsy' value of 0 to be treated as infinity, and therefore sort before everything else. I believe plain cmp should be used instead.
The text was updated successfully, but these errors were encountered:
Original issue 1352 created by danielkza2 on 2014-03-20T03:11:09.000Z:
Quodlibet version: 3.0.99 from Fedora 20 unstable repo.
Albums with a total rating of 0.0 (I noticed because I have lots of unrated albums and set the default rating to 0) sort before everything else in the Album List browser.
This is caused by a mistake in the sorting function in quodlibet/browsers/albums/main.py:
Notice the use of
cmpa
for the rating: it causes the 'falsy' value of 0 to be treated as infinity, and therefore sort before everything else. I believe plaincmp
should be used instead.The text was updated successfully, but these errors were encountered: