From 5be69084a1be707768b4f7f5e26e551c96476e47 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Thu, 18 Jan 2024 22:46:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Minor=20renamings.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/config.py | 5 +++-- tidal_dl_ng/download.py | 1 - tidal_dl_ng/gui.py | 25 +++++++++++++------------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py index fcf8291..95d30d9 100644 --- a/tidal_dl_ng/config.py +++ b/tidal_dl_ng/config.py @@ -85,10 +85,10 @@ class Tidal(BaseConfig, metaclass=SingletonMeta): settings: Settings = None def __init__(self, settings: Settings = None): - self.session = tidalapi.Session() + tidal_config: tidalapi.Config = tidalapi.Config(item_limit=10000) + self.session = tidalapi.Session(tidal_config) # self.session.config.client_id = "km8T1xS355y7dd3H" # self.session.config.client_secret = "vcmeGW1OuZ0fWYMCSZ6vNvSLJlT3XEpW0ambgYt5ZuI=" - self.session.video_quality = tidalapi.VideoQuality.high self.file_path = path_file_token() self.token_from_storage = self.read(self.file_path) self.login_token() @@ -102,6 +102,7 @@ class Tidal(BaseConfig, metaclass=SingletonMeta): self.settings = settings self.session.audio_quality = self.settings.data.quality_audio + self.session.video_quality = tidalapi.VideoQuality.high return True diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index fbe3517..c1cea95 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -334,7 +334,6 @@ class Download: # Iterate through list items while not progress.finished: for media in items: - # TODO: Handle return value of `track` method. # Download the item. status_download, result_path_file = self.item( path_base=path_base, diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 6461fe1..eccf3f4 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -111,7 +111,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): # self.pb_progress.setVisible() self.statusbar.addPermanentWidget(pb) - def progress_reset(self): + def on_progress_reset(self): self.pb_list.setValue(0) self.pb_item.setValue(0) @@ -204,6 +204,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): for item in l_cb: idx = item["element"].findText(item["setting"]) + if idx > -1: item["element"].setCurrentIndex(idx) else: @@ -342,37 +343,37 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.b_search.clicked.connect( lambda: self.search_populate_results(self.l_search.text(), self.cb_search_type.currentData()) ) - self.cb_quality_audio.currentIndexChanged.connect(self.quality_set_audio) - self.cb_quality_video.currentIndexChanged.connect(self.quality_set_video) + self.cb_quality_audio.currentIndexChanged.connect(self.on_quality_set_audio) + self.cb_quality_video.currentIndexChanged.connect(self.on_quality_set_video) self.tr_lists_user.itemClicked.connect(self.on_list_items_show) self.spinner_start[QtWidgets.QWidget].connect(self.on_spinner_start) self.spinner_stop.connect(self.on_spinner_stop) - self.s_item_advance.connect(self.progress_item) - self.s_item_name.connect(self.progress_item_name) - self.s_list_advance.connect(self.progress_list) - self.s_pb_reset.connect(self.progress_reset) + self.s_item_advance.connect(self.on_progress_item) + self.s_item_name.connect(self.on_progress_item_name) + self.s_list_advance.connect(self.on_progress_list) + self.s_pb_reset.connect(self.on_progress_reset) self.s_populate_tree_lists.connect(self.on_populate_tree_lists) - def progress_list(self, value: float): + def on_progress_list(self, value: float): self.pb_list.setValue(int(math.ceil(value))) - def progress_item(self, value: float): + def on_progress_item(self, value: float): self.pb_item.setValue(int(math.ceil(value))) - def progress_item_name(self, value: str): + def on_progress_item_name(self, value: str): self.pb_item.setFormat(f"%p% {value}") def progress_list_name(self, value: str): self.pb_list.setFormat(f"%p% {value}") - def quality_set_audio(self, index): + def on_quality_set_audio(self, index): self.settings.data.quality_audio = Quality(self.cb_quality_audio.itemData(index).value) self.settings.save() if self.tidal: self.tidal.settings_apply() - def quality_set_video(self, index): + def on_quality_set_video(self, index): self.settings.data.quality_video = QualityVideo(self.cb_quality_video.itemData(index).value) self.settings.save()