show fanart via python code?
#1
Hi, I was advised here to ask for help.

I'd like to press a button my controller and have the fanart shown via JSON/python

What I want is already working in Estuary if I go to movie and press i on my keyboard. There you see the option "Show fanart".

I want the same. Only difference is I want to map a button on my controller and press e.g. "Y". Then it should show the fanart. 

Is there a way to do it? Thanks a lot!
Reply
#2
Check out the addon called Keymap Editor
Reply
#3
(2022-07-13, 18:38)Sidewinder_2011 Wrote: Check out the addon called Keymap Editor

hi, thank you. I had a look but couldn't find a "Show Fanart" option.
Reply
#4
@3000 what about mapping a button so it shows the info , just like if u was pressing i on the keyboard.
Reply
#5
I have mapped info for many years already. I am interested in "show fanart".
Reply
#6
via JSON ?
Reply
#7
When I get home I will look into more , on hoilday untill Friday only got my phone. Misses wouldn't let me take my laptop lol
Reply
#8
There is a JSON RPC call to get the artwork VideoLibrary.GetAvailableArt and then there is a JSON RPC call to play an image file. 

Here's a call I use:

json_query = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Player.Open",   "params":{"item":{"file":%s }},"id":1}' % (playitem))

If you wanted to tie it to a button then one option might be to create a simple addon that fetches and displays the fanart with the calls above.  Then make the addon callable and map it to a button.  There are a couple of different ways to run/call an addon like this.

My 2 cents.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#9
@3000 I've tested this and works , i download the hello world addon from here https://kodi.wiki/view/HOW-TO:HelloWorld_addon

I edited the addon.py file , removed all text in the file and added this

python :

import xbmc

xbmc.executebuiltin('ShowPicture(%s)'%(xbmc.getInfoLabel("ListItem.Art(fanart)")))

If your using kodi 19 then edit the file addon.xml
Change the part that says version 2.14.0 to 3.0.0

Once you have done that install the addon

Next go to keymap editor then to global then scroll down to addons select launch hello world add on and map it to a button .

Now test it out highlight a movie and press the button you have mapped it to and the fanart should come up . Let me know how it goes and let me know if this is what u wanted
Reply
#10
(2022-07-15, 23:08)Sidewinder_2011 Wrote: @3000 I've tested this and works , i download the hello world addon from here https://kodi.wiki/view/HOW-TO:HelloWorld_addon

python :

import xbmc

xbmc.executebuiltin('ShowPicture(%s)'%(xbmc.getInfoLabel("ListItem.Art(fanart)")))

Nice solution.  This is exactly why I often prefer the builtin methods to JSON RPC.

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#11
@jbinkley60 thanks , I prefer builtin methods
Reply
#12
Well, I'll be damned!!! 

@jbinkley60 I was about to ask some questions regarding the json query. (I couldn't make it work,) but I'm very thankful for your input. Appreciated!

@Sidewinder_2011 your solution is almost perfect! Thanks a lot!! There is just one (small) thing... There is a noticeable delay when sending the command. Picture turns black at first. That's not the case when I press "Show Fanart" manually. Any idea how to fix that too? 

Having said that, I'm already really excited as it is. I love to have a look at the fanart while going through my collection. It will be very useful to me!
Reply

Logout Mark Read Team Forum Stats Members Help
show fanart via python code?0