summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-05-24 09:31:37 +0200
committerRobert Honz <exislow+github@gmail.com>2024-05-24 09:31:37 +0200
commit182e53179894f129ee6a2b590fff72c4b5e4c500 (patch)
tree6e45a143012641b036d1cfba0db46cab9ac47c01 /tidal_dl_ng/helper
parente0d0b8ec8cc245ae8a7e115b900fd6bc7587c674 (diff)
downloadtidal-dl-ng-182e53179894f129ee6a2b590fff72c4b5e4c500.tar.gz
🛠️ Fixed crash on right click -> download a favorite list.
Diffstat (limited to 'tidal_dl_ng/helper')
-rw-r--r--tidal_dl_ng/helper/tidal.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tidal_dl_ng/helper/tidal.py b/tidal_dl_ng/helper/tidal.py
index 2eece35..4b04bb7 100644
--- a/tidal_dl_ng/helper/tidal.py
+++ b/tidal_dl_ng/helper/tidal.py
@@ -5,6 +5,7 @@ from tidalapi.artist import Artist, Role
from tidalapi.media import MediaMetadataTags, Quality
from tidalapi.session import SearchTypes
+from tidal_dl_ng.constants import FAVORITES
from tidal_dl_ng.constants import MediaType
from tidal_dl_ng.helper.exceptions import MediaUnknown
@@ -192,3 +193,10 @@ def quality_audio_highest(media: Track | Album) -> Quality:
quality = media.audio_quality
return quality
+
+
+def favorite_function_factory(tidal, favorite_item: str):
+ function_name: str = FAVORITES[favorite_item]["function_name"]
+ function_list: Callable = getattr(tidal.session.user.favorites, function_name)
+
+ return function_list