Skip to content

Commit

Permalink
readded new playlist functionnality
Browse files Browse the repository at this point in the history
  • Loading branch information
fcusson committed Nov 5, 2021
1 parent c424aed commit e681378
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions custom_components/spotcast/spotcast_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,10 @@ def get_playlists(self, account, playlist_type, country_code, locale, limit):
resp = {}

if playlist_type == "discover-weekly":
resp = client._get(
"views/made-for-x",
content_limit=limit,
locale=locale,
platform="web",
types="album,playlist,artist,show,station",
limit=limit,
offset=0,
)
resp = resp.get("content")
playlist_type = "made-for-x"

if playlist_type == "user" or playlist_type == "default" or playlist_type == "":
resp = client.current_user_playlists(limit=limit)
elif playlist_type == "featured":
resp = client.featured_playlists(
locale=locale,
Expand All @@ -297,6 +290,15 @@ def get_playlists(self, account, playlist_type, country_code, locale, limit):
)
resp = resp.get("playlists")
else:
resp = client.current_user_playlists(limit=limit)
resp = client._get(
"views/" + playlist_type,
content_limit=limit,
locale=locale,
platform="web",
types="album,playlist,artist,show,station",
limit=limit,
offset=0,
)
resp = resp.get("content")

return resp

0 comments on commit e681378

Please sign in to comment.