diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-02-26 07:49:37 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-02-26 07:49:37 +0100 |
| commit | 17dc336d44a34e9265eaba261ed0ad9f43058c15 (patch) | |
| tree | 500997c06d099760b7a8698cb6b9910ac5356d2b | |
| parent | 7cbfd68e2aa843309238ff6c593a9f617377fcf4 (diff) | |
| download | tidal-dl-ng-17dc336d44a34e9265eaba261ed0ad9f43058c15.tar.gz | |
🛠`dl` object will be re-created after settings update to apply settings immediately. Related to #49
| -rw-r--r-- | tidal_dl_ng/gui.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 34a42f7..6cd1e2d 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -122,25 +122,27 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): sys.exit(1) if result: - # Init `Download` object. - data_pb: ProgressBars = ProgressBars( - item=self.s_item_advance, - list_item=self.s_list_advance, - item_name=self.s_item_name, - list_name=self.s_list_name, - ) - progress: Progress = Progress() - self.dl = Download( - session=self.tidal.session, - skip_existing=self.tidal.settings.data.skip_existing, - path_base=self.settings.data.download_base_path, - fn_logger=logger_gui, - progress_gui=data_pb, - progress=progress, - ) - + self._init_dl() self.thread_it(self.tidal_user_lists) + def _init_dl(self): + # Init `Download` object. + data_pb: ProgressBars = ProgressBars( + item=self.s_item_advance, + list_item=self.s_list_advance, + item_name=self.s_item_name, + list_name=self.s_list_name, + ) + progress: Progress = Progress() + self.dl = Download( + session=self.tidal.session, + skip_existing=self.tidal.settings.data.skip_existing, + path_base=self.settings.data.download_base_path, + fn_logger=logger_gui, + progress_gui=data_pb, + progress=progress, + ) + def _init_progressbar(self): self.pb_list = QtWidgets.QProgressBar() self.pb_item = QtWidgets.QProgressBar() @@ -348,6 +350,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def on_settings_save(self): self.settings.save() self.apply_settings(self.settings) + self._init_dl() def search(self, query: str, types_media: SearchTypes) -> [ResultItem]: # If a direct link was searched for, skip search and create the object from the link directly. |
