summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-01-19 07:34:32 +0100
committerRobert Honz <exislow+github@gmail.com>2024-01-19 07:34:32 +0100
commit53c8db80f8884c0e08e4f2908caaaf1a8e0e5697 (patch)
treec46d9076935864da638880f70ca24dc7003f60ab /tidal_dl_ng/helper
parent8e9e2c1794c44033438d9808fd4487f5b822725f (diff)
downloadtidal-dl-ng-53c8db80f8884c0e08e4f2908caaaf1a8e0e5697.tar.gz
♻️ Refactoring of tidal related function. Cleaned up TODOs.
Diffstat (limited to 'tidal_dl_ng/helper')
-rw-r--r--tidal_dl_ng/helper/tidal.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tidal_dl_ng/helper/tidal.py b/tidal_dl_ng/helper/tidal.py
index 60f636d..9c4eeba 100644
--- a/tidal_dl_ng/helper/tidal.py
+++ b/tidal_dl_ng/helper/tidal.py
@@ -1,4 +1,4 @@
-from tidalapi import Album, Mix, Playlist, Session, Track, Video
+from tidalapi import Album, Mix, Playlist, Session, Track, UserPlaylist, Video
from tidalapi.session import SearchTypes
from tidal_dl_ng.constants import MediaType
@@ -96,3 +96,11 @@ def items_results_all(media_list: [Mix | Playlist | Album], videos_include: bool
done = True
return result
+
+
+def user_media_lists(session: Session) -> [Playlist | UserPlaylist | Mix]:
+ user_playlists: [Playlist | UserPlaylist] = session.user.playlist_and_favorite_playlists()
+ user_mixes: [Mix] = session.mixes().categories[0].items
+ result: [Playlist | UserPlaylist | Mix] = user_playlists + user_mixes
+
+ return result