XBMC Community Forum
Get fanart of playing media - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: Get fanart of playing media (/showthread.php?tid=133343)



Get fanart of playing media - AddonScriptorDE - 2012-06-06 17:43

Hi,
i have another question:
Is there a way to access the fanart-path of the currently played movie/series? I am doing it via json right now, but its slow with large dbs, see here.
A lot of infos are available via "xbmc.Player().getVideoInfoTag()" / "xbmc.getInfoLabel('VideoPlayer.XXXXX')" / "xbmc.getInfoImage(VideoPlayer.XXXXX)", but the fanart is missing...

Thanks again,
asde


RE: Currently played movie/series: Get fanart path - jmarshall - 2012-06-06 23:41

The fanart is available on the item, not on the tag. Can you get the labeel and path info?


RE: Currently played movie/series: Get fanart path - AddonScriptorDE - 2012-06-07 00:26

(2012-06-06 23:41)jmarshall Wrote:  The fanart is available on the item, not on the tag.
Could you please give me a code example for receiving the item (fanart) on the currently playing media (not the selected item)?
I couldn't find anything on how to receive the currently playing ListItem.

The playing PlayListItem could be received with:
Code:
playListItem = playlist[playlist.getposition()]
but it does not contain the fanart-path.

(2012-06-06 23:41)jmarshall Wrote:  Can you get the labeel and path info?
Yes, the label is available via "xbmc.Player().getVideoInfoTag().getTitle()". "xbmc.Player().getVideoInfoTag().getPath()" returns an empty string. But its also available via xbmc.Player().getPlayingFile().
The label and the path are also available this way:
Code:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
title = playlist[playlist.getposition()].getdescription()
url = playlist[playlist.getposition()].getfilename()



RE: Currently played movie/series: Get fanart path - AddonScriptorDE - 2012-06-11 13:40

(2012-06-06 23:41)jmarshall Wrote:  The fanart is available on the item...
If its really available, does nobody know how to get it?
Please, i tried everything possible and have read all the online documents.

Cant get it working...


RE: Currently played movie/series: Get fanart path - AddonScriptorDE - 2012-06-19 14:31

(2012-06-06 23:41)jmarshall Wrote:  The fanart is available on the item...
Could you please reveal the secret of getting the fanart of the currently played media?
That would be really nice Wink


RE: Get fanart of playing media - jmarshall - 2012-06-20 00:08

Does JSON-RPC give it to you?


RE: Get fanart of playing media - AddonScriptorDE - 2012-06-20 00:23

(2012-06-20 00:08)jmarshall Wrote:  Does JSON-RPC give it to you?
(2012-06-06 17:43)AddonScriptorDE Wrote:  Hi,
i have another question:
Is there a way to access the fanart-path of the currently played movie/series? I am doing it via json right now, but its slow with large dbs, see here.
A lot of infos are available via "xbmc.Player().getVideoInfoTag()" / "xbmc.getInfoLabel('VideoPlayer.XXXXX')" / "xbmc.getInfoImage(VideoPlayer.XXXXX)", but the fanart is missing...

Thanks again,
asde
Sure, all other properties are directly available without json. Except the fanart...
Your first answer sounds like it could be done without the JSON-RPC.

So its not possible?


RE: Get fanart of playing media - jmarshall - 2012-06-20 00:59

I didn't say it could be done. I said it was in the same box as the label or path, neither of which are available correctly from python - you can get the title and the path according to the videoinfotag, but these are not the same as the items label and path (path most likely will be correct for many items, but may not necessarily always be correct). By the looks of things, you don't get access to the actual item playing, rather only it's videoinfotag which does not hold the information you want.

It makes no sense as a general infolabel, as the skin won't use it and you don't want to display the info. Thus, the correct place to put it is in some general "Player.GetMeAllTheInfoDamnit" or via JSON-RPC. I'm sure that fanart would be useful for the latter either way, and should already be possible I would have thought (you get an item, so should be able to get the metadata information for that item).


RE: Get fanart of playing media - AddonScriptorDE - 2012-06-20 01:40

(2012-06-20 00:59)jmarshall Wrote:  I didn't say it could be done. I said it was in the same box as the label or path, neither of which are available correctly from python - you can get the title and the path according to the videoinfotag, but these are not the same as the items label and path (path most likely will be correct for many items, but may not necessarily always be correct). By the looks of things, you don't get access to the actual item playing, rather only it's videoinfotag which does not hold the information you want.

It makes no sense as a general infolabel, as the skin won't use it and you don't want to display the info. Thus, the correct place to put it is in some general "Player.GetMeAllTheInfoDamnit" or via JSON-RPC. I'm sure that fanart would be useful for the latter either way, and should already be possible I would have thought (you get an item, so should be able to get the metadata information for that item).
"Player.GetMeAllTheInfoDamnit" - Yeah, that would be a nice InfoLabel Wink

My way for getting the fanart via json was not very smart. I couldnt get the id of the playing item, so i had to receive all videos via VideoLibrary.GetMovies/GetEpisodes and the search for the fanart - Slow with large DBs. But you pointed me to the right direction via the JSON-RPC: Player.GetItem - I missed this before.
Thanks for your help!