summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/gui.py
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-11-12 19:15:33 +0100
committerRobert Honz <exislow+github@gmail.com>2024-11-12 19:15:33 +0100
commit618b16257b6f398345bac467aa2706f7385ff577 (patch)
treefca209e4983e81cc2ae3a64ef4731051ee794a7e /tidal_dl_ng/gui.py
parent4cef07b08f16410f56fa53a34884ce3b5dd6b64e (diff)
downloadtidal-dl-ng-618b16257b6f398345bac467aa2706f7385ff577.tar.gz
✨ Backend and GUI changed to device login. Login dialog needs to be threaded / non blocking.
Diffstat (limited to 'tidal_dl_ng/gui.py')
-rw-r--r--tidal_dl_ng/gui.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py
index 7aa2150..4cc3150 100644
--- a/tidal_dl_ng/gui.py
+++ b/tidal_dl_ng/gui.py
@@ -128,14 +128,16 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
result = self.tidal.login_token()
if not result:
- hint: str = "Watiting for user input."
+ hint: str = "After you have finished the TIDAL login via web browser click the 'OK' button."
+
while not result:
- url_login = self.tidal.session.pkce_login_url()
- d_login: DialogLogin = DialogLogin(url_login=url_login, hint=hint, parent=self)
- url_redirect: str = d_login.url_redirect
+ login, future = self.tidal.session.login_oauth()
+
+ d_login: DialogLogin = DialogLogin(url_login=login.verification_uri_complete, hint=hint, expires_in=login.expires_in, parent=self)
if d_login.return_code == 1:
try:
+ future.result()
token: dict[str, str | int] = self.tidal.session.pkce_get_auth_token(url_redirect)
self.tidal.session.process_auth_token(token)
self.tidal.login_finalize()