wizmo2 / zidoo-player

Home-assistant custom component and api wrapper for Zidoo Media Players
22 stars 4 forks source link

Thumbnail not showing up in any media card #16

Closed Zarrickisdea closed 1 year ago

Zarrickisdea commented 1 year ago

like the title says, I can never get the artwork that pops up when playing media to show in any media card, both custom-mini-media-player and in the default card. Logs don't really show anything, but the developer tools show console errors.

Zarrickisdea commented 1 year ago

looking deeper into developer tools, theres a status 804 after an api call, maybe thats the issue. If it is, any way to solve it?

wizmo2 commented 1 year ago

What is the HA version? Are you using NubaCasa, HassOS, or some other configuration. 804 is a SSL error. If not hosted, how is https setup (natively or reverse proxy)? Can you copy and paste the log error details?

For videos, the images on the player are the HT4 backdrop, so check to see if it has a valid backdrop image. Do you see images in the media browser movie list? (these are artwork images) Do you get the same results when accessing from the local network and/or remotely? Do you get images when playing a music file? You could try a full browser cache clear and reboot everything.

Zarrickisdea commented 1 year ago

Running the latest HA version (2023.5.3) in a docker container on a raspberry pi 4. I don't have https setup anywhere.

Screenshot 2023-05-18 at 10 22 23 Screenshot 2023-05-18 at 10 26 45 Screenshot 2023-05-18 at 10 27 02

Most of the media I have do have valid backdrop images. Media browser works perfect, its only the media player artwork that doesn't show up. I've also tried different media player cards to see if this was related to the specific card I'm using. I don't access remotely, only from the local network. Music files also don't show any image. I've rebooted everything, cleared browser cache and it does not work. Just to sanity check, I've also uninstalled the integration and reinstalled it to no effect. BTW no specific errors show up in home assistant logs with debug logging on, the only errors i was able to find are from the browser dev tools. My other media players (Chromecast and Apple TV) shows images without any issues.

wizmo2 commented 1 year ago

My guess is its an issue specific to the Z10pro api support. The last image looks like a zidoo api error response. I only have a Z9S and Z9X, and they are working.

if you are willing to give it a go,

  1. Go to Settings, Device, Integrations. Select the Zidoo Player, press the 3-dot icon and select "Enable debug logging"

  2. Start an new move and go to the logs to get the "mediaid" number from one of the debug messages that looks like "play: media_id:533 mediatype:movie" There'll be other messages that show the player IP address if you don't know it.

  3. In your browser, enter http://<your player ip>:9529/ZidooPoster/getFile/getPoster?id=<media_id>&w=600&h=400 to see if you get the same error, or it displays an image

  4. If that does not work, we could try the v2 api call http://<your player ip>/Poster/v2/getPoster?id=<media_id>&w=600&h=400

Zarrickisdea commented 1 year ago

Both of them work and display the correct image.

Zarrickisdea commented 1 year ago

By the way debug logging, didn't show anything related to movie ID so I used the api to get the movie id manually. I don't know if this is a home assistant thing or I messed up somehow.

Zarrickisdea commented 1 year ago

Uncommented line 1406 in zidoorc.py and got this in the home assistant log Screenshot 2023-05-19 at 11 26 44

Zarrickisdea commented 1 year ago

Alright, apologies for the repeated comments. Also ignore the previous log comment

I spent some time reading the pertinent parts of your code and narrowed down the issue. In the original code, def _get_id_from_uri(self, uri) is the function to get the backdrop image. This is your original code

Screenshot 2023-05-19 at 12 12 06

This is what I did to my setup after some manual api calls and debugging (btw zidoo api is kind of ass, you're right) Screenshot 2023-05-19 at 12 13 53

I believe the reason might be because I'm running the latest beta firmware from the forums v6.4.62.

Maybe your firmware is older and your original code works for that.

wizmo2 commented 1 year ago

Thanks for this. Excellent work!
You're right, I have not been keeping up on the latest betas, and missed this 6.4.62 announcement completely! It mentions changes to web interface. I need to check it out.

I'll merge your changes and test to see if there is anything else broken. You never know, they may have added some of the functionally I requested!

Zarrickisdea commented 1 year ago

No problems. Found this in the clipboard today, responses from getAggregationOfFile. Screenshot 2023-05-20 at 10 29 24 Screenshot 2023-05-20 at 10 22 43

Just in case you need to see how they changed things.

wizmo2 commented 1 year ago

the current main branch should address this issue (thanks @Zarrickisdea).
I'll plan to make a new release in the next few weeks.

wizmo2 commented 1 year ago

I'm closing this with release 1.4.0, which should address.