mattblovell / kodi_panel

Front panel LCD display for Kodi (via JSON-RPC)
MIT License
12 stars 5 forks source link

problem retreiving thumb stored on kodi file system #39

Closed nico1080 closed 3 years ago

nico1080 commented 3 years ago

Kodi panel cannot retreive artwork when it is stored on kodi filesystem. (inside storage) I used kodi 18.9 on libreelec Eg "VideoPlayer.Cover":"/storage/backup/xbmc_videodb_2017-05-20/movies/Django_Unchained_2012-poster.jpg"}}will not display but "VideoPlayer.Cover":"https://artworks.thetvdb.com/banners/series/253573/episodes/6005a5f5959c7.jpg"} will display fine {"VideoPlayer.Cover":"image://video@smb%3a%2f%2fNAS%2fdata%2fmusic%20video%2fmotorhead%2fstage%20fright%2fMotorhead.Stage.Fright.HDDVDRemux.VC1.1080p.mkv/"}} will also display fine

mattblovell commented 3 years ago

Is kodi_panel running on the same host or a different host than Kodi? The filesystem path in the first example (/storage/backup/...) is, of course, not naturally accessible over the network. Some step is necessary to make it accessible, and this section of code

https://github.com/mattblovell/kodi_panel/blob/6b0fe6b3126e46a0285c3afb54437eeeadbbd485/kodi_panel_display.py#L1151-L1159

is the Files.PrepareDownload JSON-RPC call that get_artwork() tries.

There are debug print() statements within get_artwork(), including one at the end of the above excerpt. Please uncomment all of those, restart kodi_panel, and provide the output.

mattblovell commented 3 years ago

With the print() statements uncommented, this is the output for music playback from a USB drive (newlines added):

image_path :  /var/media/Music/iTunes/Enya/A Day Without Rain/Folder.jpg
Prepare Response:  {"id": 5, "jsonrpc": "2.0", 
  "result": {"details": 
   {"path": "vfs/%2fvar%2fmedia%2fMusic%2fiTunes%2fEnya%2fA%20Day%20Without%20Rain%2fFolder.jpg"},
    "mode": "redirect", "protocol": "http"}}

That's the closest I can get with the current setup of my media library. The above does work.

Note that the filesystem source for artwork must be a path that Kodi is willing to share. For the AirPlay cover art, for instance, I was stymied retrieving art over the network until I added special://temp to the list of media sources. Until I made that addition, the attempt at downloading never succeeded. The Files.PrepareDownload JSON-RPC call would behave perfectly normally, but the final retrieval URL never worked! My Kodi forum post on that topic:

Airplay thumbnail and JSON-RPC https://forum.kodi.tv/showthread.php?tid=359040

I don't know the status of /storage/backup. Is that a standard media source for Kodi?

mattblovell commented 3 years ago

Augmenting my post above...

Using the returned path in the response above to form the URL

http://10.0.0.188:8080/vfs/%2fvar%2fmedia%2fMusic%2fiTunes%2fEnya%2fA%20Day%20Without%20Rain%2fFolder.jpg

works to retrieve the cover art from the USB drive for a normal web browser. If you capture the PrepareDownload response for your file, you can try the same. If the web browser isn't able to retrieve the image, the problem is on the Kodi side of things.

nico1080 commented 3 years ago

I use a remote kodi (kodi with libreelec 9.2.5) and kodi panel on remote rpi with pi is (buster)

I have the folowing output for the debug

2021-01-31 08:34:01.870462 Starting
2021-01-31 08:34:02.006816 Trying ping...
2021-01-31 08:34:02.021038 Connected with Kodi.  Entering update_display() loop.
Response:  {"id": 5, "jsonrpc": "2.0", "result": {"details": {"path": "vfs/%2fst                                                                                                             orage%2fbackup%2fxbmc_videodb_2017-05-20%2fmovies%2fDjango_Unchained_2012-poster                                                                                                             .jpg"}, "mode": "redirect", "protocol": "http"}}

The urls do not work: http://192.168.1.51/storage/backup/xbmc_videodb_2017-05-20/movies/Django_Unchained_2012-poster.jpg or http://192.168.1.51/vfs/%2fstorage%2fbackup%2fxbmc_videodb_2017-05-20%2fmovies%2fDjango_Unchained_2012-poster.jpg or http://192.168.1.51/%2fstorage%2fbackup%2fxbmc_videodb_2017-05-20%2fmovies%2fDjango_Unchained_2012-poster.jpg

I then added /storage to my kodi source (in the video section but I am not sure it matters) and everything work (above URLS and retreiveing in kodi panel

Resulting video section sources.xml file in Userdata:

- <source>
  <name>storage</name> 
  <path pathversion="1">/storage/</path> 
  <allowsharing>true</allowsharing> 
  </source>

In conclusion: for thumb stored on kodi filesystem , one need to add a source in kodi to make this file system accesible via the http method In my case (Libreelec) I added /storage as thumb may be available in other folder than /storage/Backup

Normaly on libreelec thumbs should be stored and retreived in /storage/.kodi/userdata/Thumbnails/ but my kodi setup is pretty old and I have made backup/migration form openelec so maybe is is because of that thumbs are stored in incorrect folder.

@mattblovell I believe this topic should be mentionned in the documentation. So I do not close it even if there is no issue with kodi_panel itself. Feel free to close it if you think it is better.

mattblovell commented 3 years ago

I added a new "Kodi Setup" section to README.rst. Closing issue.