summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/config.py
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2024-02-05 06:33:22 +0100
committerGitHub <noreply@github.com>2024-02-05 06:33:22 +0100
commit9dd9e49fa7c6540e5e6051becdabaf7f48dd31eb (patch)
tree6a98e23b9576377c382c21e65772549bfb08a5eb /tidal_dl_ng/config.py
parent957f6b2d4e47831967daab47a025a7583da80e12 (diff)
parent4ed2a67e4c887c7d25b2888a679e985136f1afd0 (diff)
downloadtidal-dl-ng-9dd9e49fa7c6540e5e6051becdabaf7f48dd31eb.tar.gz
Merge pull request #34 from exislow/reload-lists
✨ GUI user lists can be reloaded. Logout is possible.
Diffstat (limited to 'tidal_dl_ng/config.py')
-rw-r--r--tidal_dl_ng/config.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py
index 92eea3b..7e93e7f 100644
--- a/tidal_dl_ng/config.py
+++ b/tidal_dl_ng/config.py
@@ -2,6 +2,7 @@ import os
import shutil
from collections.abc import Callable
from json import JSONDecodeError
+from pathlib import Path
from typing import Any
import tidalapi
@@ -158,3 +159,10 @@ class Tidal(BaseConfig, metaclass=SingletonMeta):
fn_print("Something went wrong. Did you login using your browser correctly? May try again...")
return result
+
+ def logout(self):
+ Path(self.file_path).unlink(missing_ok=True)
+ self.token_from_storage = False
+ del self.session
+
+ return True