Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

album art not showing when playing from pandora #582

Closed
randyarrasmith opened this issue Mar 8, 2020 · 5 comments · Fixed by #589
Closed

album art not showing when playing from pandora #582

randyarrasmith opened this issue Mar 8, 2020 · 5 comments · Fixed by #589

Comments

@randyarrasmith
Copy link

Album art not showing when playing from pandora.
(aside: The mini-media-player does show art)

Looking at the web inspector it appears the album art is coming from https://dyn-images.p-cdn.com.

When playing music from amazon and not pandora album art works fine. The background image url / entity_picture is https://m.media-amazon.com

While troubleshooting I have updated this component, reinstalled the component and also update to latest HA version.

System details

  • Home-assistant (version): 0.106.5
  • HA from dockerhub
  • alexa_media (version HACS): v2.5.6
  • alexapy (version from pip show alexapy or HA startup): 1.5.1
@alandtse
Copy link
Owner

Can you provide the attributes for the media player while playing Pandora? Also, if you use the webapp, does it show album art?

@randyarrasmith
Copy link
Author

randyarrasmith commented Mar 12, 2020

Sorry, I thought I had provided the platforms I tested in; I have tested in Safari(mac), Chrome(mac), and the HA iOS app.
I have alexa_media_player installed via hacs so no additional config there.
My lovelace config is:

 - entity: media_player.office
      type: media-control

(I have no idea why the code block is ignoring a new line. The yaml is properly configured in my config)

attributes shown in developer tools while playing :
source_list: Local Speaker
volume_level: 0.23
is_volume_muted: false
media_content_type: music
media_duration: 313
media_position: 1
media_position_updated_at: 2020-03-12T02:38:28.975403+00:00
media_title: Hells Bells
media_artist: AC/DC
media_album_name: Pandora
source: Local Speaker
available: true
last_called: true
last_called_timestamp: 1583980705780
friendly_name: Office
entity_picture: https://dyn-images.p-cdn.com/?l=images%2Fpublic%2Fint%2F3%2F2%2F0%2F5%2F075678165023%3Acover()&w=500&h=500
supported_features: 56253

EDIT: Fixed code block, please take a look on how to address in future.

@alandtse
Copy link
Owner

Ok, I was able to confirm it. However, if the entity_picture attribute is populating, then it's up the HA UI to figure out how to display it.

The custom_component won't be able to change anything that the UI does. If you see a use case where the entity_picture is not being populated, then we may be able to do something on the component side. We are literally providing the information from the Alexa media API which is successfully displayed by Amazon UI elements and the mini-media-player. It's also possible that Pandora is passing back an invalid URL and the UI team will say it's the components job to catch bad data from the API. I don't think that's the right response to this but may consider that.

While I don't know the specifics of the UI, it's probably because of the ) after cover not being escaped in the url for the back-image css styling.

This is what I see in chrome.

<div class="image" style="background-image: url(https://dyn-images.p-cdn.com/?l=images%2Fpublic%2Fint%2F0%2F8%2F9%2F4%2F00602577464980%3Acover()&amp;w=500&amp;h=500)"></div>

You'll need to report it to the HA UI team and point out that mini-media-player properly handles it.
Of course, if you tell them it's from a custom component they may say they won't fix it.

@alandtse
Copy link
Owner

By the way, I have a fix, but HA should really fix it in their own code or any other media player may have the problem and they should guard their own input.

alandtse added a commit that referenced this issue Mar 15, 2020
fix: quote pandora media urls
@randyarrasmith
Copy link
Author

Thank you, Alan. I appreciate you looking into this. I love the Alexa_media_player integration. Glad you were able to find a workaround :) You guys are awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants