fix: sort by # now uses track_num from UserRole instead of cell text, so EQ animation doesn't break sorting
This commit is contained in:
parent
199fb43f04
commit
a1d6465730
@ -43,10 +43,11 @@ EQ_FRAMES = [
|
|||||||
|
|
||||||
class NumericTableItem(QTableWidgetItem):
|
class NumericTableItem(QTableWidgetItem):
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
try:
|
_, self_data = self.data(Qt.ItemDataRole.UserRole) or (False, {})
|
||||||
return int(self.text()) < int(other.text())
|
_, other_data = other.data(Qt.ItemDataRole.UserRole) or (False, {})
|
||||||
except ValueError:
|
self_num = (self_data or {}).get("track_num", 0) or 0
|
||||||
return super().__lt__(other)
|
other_num = (other_data or {}).get("track_num", 0) or 0
|
||||||
|
return self_num < other_num
|
||||||
|
|
||||||
|
|
||||||
class LibraryTab(QWidget):
|
class LibraryTab(QWidget):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user