Skip to content

Commit

Permalink
fix: quote pandora media urls
Browse files Browse the repository at this point in the history
closes #582
  • Loading branch information
alandtse committed Mar 15, 2020
1 parent 5b07987 commit 2ff9e9a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/alexa_media/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"""
import asyncio
import logging
from typing import List # noqa pylint: disable=unused-import
import re
from typing import List, Text # noqa pylint: disable=unused-import

from homeassistant import util
from homeassistant.components.media_player import MediaPlayerDevice
Expand Down Expand Up @@ -808,9 +809,12 @@ def media_position_updated_at(self):
return self._last_update

@property
def media_image_url(self):
def media_image_url(self) -> Text:
"""Return the image URL of current playing media."""
return self._media_image_url
if self._media_image_url:
return re.sub("\\(", "%28", re.sub("\\)", "%29", self._media_image_url))
# fix failure of HA media player ui to quote "(" or ")"
return None

@property
def media_image_remotely_accessible(self):
Expand Down

0 comments on commit 2ff9e9a

Please sign in to comment.