Skip to content

Commit

Permalink
correction for fondberg#267
Browse files Browse the repository at this point in the history
  • Loading branch information
fcusson committed Dec 16, 2021
1 parent 24417d8 commit 5f65409
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions custom_components/spotcast/spotcast_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ def get_spotify_device_id(self, account, spotify_device_id, device_name, entity_
)
return spotify_device_id


def _clean_uri(self, uri):

# remove anything after ?
uri = uri.split("?")[0]

return uri

def play(
self,
client,
Expand All @@ -220,6 +228,10 @@ def play(
uri,
spotify_device_id,
)

# clean uri
uri = self._clean_uri(uri)

if uri.find("show") > 0:
show_episodes_info = client.show_episodes(uri)
if show_episodes_info and len(show_episodes_info["items"]) > 0:
Expand Down

0 comments on commit 5f65409

Please sign in to comment.