Skip to content

Commit

Permalink
Merge pull request #263 from fondberg/corr_261
Browse files Browse the repository at this point in the history
final corr for #261
  • Loading branch information
fcusson authored Nov 5, 2021
2 parents a25c17b + 1c67d29 commit ade2ea0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__VERSION__ = "3.6.20"
__VERSION__ = "3.6.21"

bump:
bump2version --allow-dirty --current-version $(__VERSION__) patch Makefile custom_components/spotcast/manifest.json
Expand Down
5 changes: 3 additions & 2 deletions custom_components/spotcast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
def setup(hass, config):

# get spotify core integration status
# if return false, could indicate a bad spotify integration. Race
# condition doesn't permit us to abort setup, see #258
if not helpers.get_spotify_install_status(hass):
_LOGGER.error("Spotify integration was not found, please verify integration is functionnal. Could result in python error...")
return False
_LOGGER.debug("Spotify integration was not found, please verify integration is functionnal. Could result in python error...")

"""Setup the Spotcast service."""
conf = config[DOMAIN]
Expand Down
2 changes: 1 addition & 1 deletion custom_components/spotcast/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"requirements": [
"spotify_token==1.0.0"
],
"version": "v3.6.20",
"version": "v3.6.21",
"dependencies": [
"spotify"
],
Expand Down
2 changes: 1 addition & 1 deletion custom_components/spotcast/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def device_state_attributes(self):
def update(self):
_LOGGER.debug("Getting playlists")

playlist_type = "playlists"
playlist_type = "user"
country_code = "SE"
locale = "en"
limit = 10
Expand Down
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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.6.20
current_version = 3.6.21

[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
Expand Down

0 comments on commit ade2ea0

Please sign in to comment.