diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-04-21 15:58:31 +0200 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-04-21 15:58:31 +0200 |
| commit | f9862e0646032628923dc696afb0fe04884eddfb (patch) | |
| tree | 266a029363b050998eb2227d59cdde68f3db80f7 /tidal_dl_ng/helper/gui.py | |
| parent | 1224e42689e27fb75b5a4a742ac37f66e1c6eb07 (diff) | |
| download | tidal-dl-ng-f9862e0646032628923dc696afb0fe04884eddfb.tar.gz | |
✨ PKCE / OAuth login will be chosen on the fly, depending on the desired audio quality of the track to speed up non `HIRES_LOSSLESS` downloads. Quality for tracks in download queue can be chosen individually. Fixes #73
Diffstat (limited to 'tidal_dl_ng/helper/gui.py')
| -rw-r--r-- | tidal_dl_ng/helper/gui.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tidal_dl_ng/helper/gui.py b/tidal_dl_ng/helper/gui.py index b18c24e..610be80 100644 --- a/tidal_dl_ng/helper/gui.py +++ b/tidal_dl_ng/helper/gui.py @@ -1,6 +1,7 @@ from PySide6 import QtCore, QtWidgets from tidalapi import Album, Mix, Playlist, Track, UserPlaylist, Video from tidalapi.artist import Artist +from tidalapi.media import Quality def get_table_data( @@ -11,6 +12,12 @@ def get_table_data( return result +def get_table_text(item: QtWidgets.QTreeWidgetItem, column: int) -> str: + result: str = item.text(column) + + return result + + def get_results_media_item(item: QtWidgets.QTreeWidgetItem) -> Track | Video | Album | Artist | Playlist | Mix: result: Track | Video | Album | Artist | Playlist | Mix = get_table_data(item, 1) @@ -31,6 +38,14 @@ def get_queue_download_media( return result +def get_queue_download_quality( + item: QtWidgets.QTreeWidgetItem, +) -> Quality: + result: Quality = get_table_text(item, 4) + + return result + + def set_table_data( item: QtWidgets.QTreeWidgetItem, data: Track | Video | Album | Artist | Mix | Playlist | UserPlaylist, column: int ): |
