Kodi Community Forum

Full Version: album art query
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to display album art for the track playing in pandoki in my control system but can seem to get it to display.

the album art is displayed in kodi on the screen

The query string i am using is 192.168.1.17:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "artist", "duration", "thumbnail", "file", "fanart", "streamdetails"], "playerid": 0 }, "id": "AudioGetItem"}


this is what it is returning

{"id":"AudioGetItem","jsonrpc":"2.0","result":{"item":{"album":"Harvest Moon","artist":["Neil Young"],"duration":343,"fanart":"","file":"http://mediaserver-nz1-t1-1.pandora.com/access/2263877690920948736.mp4?version=4&lid=944056516&token=Tl71CEDYTpp1xXdQ4%2BQoszsIWLFs3i4PsmpoCFN%2F3IWUN53XiOH4RW1KYTIFD2L7uq​BellnSd6obT6c6IEjPtfM7mXIGyZWUK0n4nmDkKiqsYbfxZRp1Hm%2FLeg06QwK3MHrmQmKVv7FdUDKS​5E8WGxV7Znm%2FYceSjrf2qRX0SuPC5KKLEzcNs3q6R6z2dpNpj58lySoNkWBqtsvfK%2BJ7w4gKNy6Q​6q9GYYHht%2B16AqvgM9SqGxGlgiBr0X2AMjNwVcOQd70lfcduiDoyfriefwjWM7R0FpD0HrfYlC00Vo​tmGe7zy%2Bn3hoyvBgFOa9Pal54Q%2FD0Vzv2bhOPxyhZC9SI%2F84A9Hydb17VMXQcabWuA7OF8ZeKG​FEi6UJ3Ex4gH","label":"War Of Man","thumbnail":"","title":"War Of Man","type":"song"}}}


i have found if i query the playlist i can find images

192.168.1.17:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Playlist.GetItems", "params": { "properties": ["thumbnail"], "playlistid": 0 }, "id": 1}

returns

{"id":1,"jsonrpc":"2.0","result":{"items":[{"label":"The Kinks","thumbnail":"image://http%3a%2f%2fcont-ch1-2.pandora.com%2fimages%2fpublic%2famz%2f5%2f3%2f1%2f5%2f800055135_500W_500H.jpg/","type":"song"},{"label":"Pandoki - Queuing Neil Young Radio","thumbnail":"image://C%3a%5cUsers%5cdave%5cAppData%5cRoaming%5cKodi%5caddons%5cplugin.audio.pandoki%5​cicon.png/","type":"song"},{"label":"Fleetwood Mac","thumbnail":"image://http%3a%2f%2fcont-ch1-1.pandora.com%2fimages%2fpublic%2frovi%2falbumart%2f8%2f2%2f1%2f4%2f075992724128​_500W_500H.jpg/","type":"song"},{"label":"Crosby, Stills, Nash & Young","thumbnail":"image://http%3a%2f%2fcont-ch1-2.pandora.com%2fimages%2fpublic%2frovi%2falbumart%2f5%2f2%2f8%2f4%2f075678264825​_500W_500H.jpg/","type":"song"}],"limits":{"end":4,"start":0,"total":4}}}

how can i do the same for currently playing
According to http://kodi.wiki/view/JSON-RPC_API/v6#Player.GetItem "thumbnail" is the proper property. My guess is, it is not being set?
But if you can get the/an image from the playlist, and you know if the player is playing, why can't you settle for the thumbnail from the playlist?
(2015-11-12, 11:32)Torben Wrote: [ -> ]According to http://kodi.wiki/view/JSON-RPC_API/v6#Player.GetItem "thumbnail" is the proper property. My guess is, it is not being set?
But if you can get the/an image from the playlist, and you know if the player is playing, why can't you settle for the thumbnail from the playlist?

I cant see a way with the playlist return how tell narrow it down to only the currently playing.

So i can choose that image to display


maybe if i add song name to the query, i can work out the way to use a variable as a tag.

( ill look into that but still open to any suggestions.)
I have a related problem.

When I send the following JSON query:
Code:
{"jsonrpc":"2.0","method":"Player.GetItem","params":{"properties":["thumbnail"],"playerid":0},"id":"1"}

I get the following return:
Code:
{"id":"1","jsonrpc":"2.0","result":{"item":{"id":25004,"label":"Set Down Your Glass","thumbnail":"image://[email protected]%3a%5cMedia%5cMuziek%5cSnow%20Patrol%5cA%20HUNDRED%20MILLION%20SUNS%20(2008)%5c01%20-%20If%20There%27s%20A%20Rocket%20Tie%20Me%20To%20It.mp3/","type":"song"}}}

Normally I would be able to view the cover in a browser by going to the following address:
Code:
http://IP:PORT/image/[email protected]%3a%5cMedia%5cMuziek%5cSnow%20Patrol%5cA%20HUNDRED%20MILLION%20SUNS%20(2008)%5c01%20-%20If%20There%27s%20A%20Rocket%20Tie%20Me%20To%20It.mp3

But because the query returns a *.mp3 this is not possible.
Most songs return a *.jpg and can be displayed when I send the above described query's, but for this it does not work. How should I fix this?
Its the image stored within the .mp3 is all I can say. If python PIL was actually implemented so it could get and send images to Kodi that could be the easy way. If it was me, Id eithet forget about it or retag and drop the artwork inside the music files.
A bit haste on that reply from my side.. you can ofcourse find the cached image in the Kodi autonomous megacache on your Kodi box. I suspect you need to make a script for that.
Can you point me in the right direction because I have no idea how or where to look.
I am not really sure what the right direction for your question is.

But to get the path to an image that is cached by kodi there is - in python - a function called somethung like getthumbnailpath(path) it is a hit and miss function and it seems like you need to modify the path somwhat before using it. I speculate it maybe just looks up in the database and what is in the database is not standardized.

I use the function and there are some images I just cannot match.

Try the addon forums if you want to take that path.
Well most important part is to not remove the leading / as it's full part of the url.

Not only that, but it also ensure that anything that renders the image does not take the .mp3 extension in account in case of problematic mimetypes.