diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-01-16 06:12:22 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-01-16 06:12:22 +0100 |
| commit | 76b007c2bb47d78a116573792ec6dfc2402f91b8 (patch) | |
| tree | 37133667cd1c32722cd614fde8a87a5e502d5d1f | |
| parent | 1ca44af435be703d289a297af0b1ce376a2cc122 (diff) | |
| download | tidal-dl-ng-76b007c2bb47d78a116573792ec6dfc2402f91b8.tar.gz | |
🛠️ Fixed sorting of results.
| -rw-r--r-- | tidal_dl_ng/gui.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 8d82b80..b4d9a4c 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -135,10 +135,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def _init_tree_results(self, tree: QtWidgets.QTableWidget): tree.setColumnHidden(5, True) + tree.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder) def populate_tree_lists(self, tidal: Tidal): # Start loading spinner - # TODO: Fix QPaint issue. App is crashing because of this. self.spinner_start.emit(self.tr_lists_user) self.tr_results.clear() @@ -218,7 +218,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): # We build the menu. menu = QtWidgets.QMenu() - menu.addAction("Dowloading Playlist", lambda: self.thread_download_list_media(point)) + menu.addAction("Download Playlist", lambda: self.thread_download_list_media(point)) menu.exec(self.tr_lists_user.mapToGlobal(point)) @@ -247,9 +247,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): # Format seconds to mm:ss. m, s = divmod(item.duration_sec, 60) duration: str = f"{m:02d}:{s:02d}" + # Since sorting happens only by string, we need to pad the index and add 1 (to avoid start at 0) + index: str = f"{item.position + 1:03}" child = QtWidgets.QTreeWidgetItem() - child.setText(0, str(item.position)) + child.setText(0, index) child.setText(1, item.artist) child.setText(2, item.title) child.setText(3, item.album) |
