Skip to content
Angelinas edited this page Jan 25, 2022 · 8 revisions

Webservice --> $INFO images inside list/panel containers and image lookups

This script comes with a little web-helper service to retrieve images that are normally only available as window property and/or only available for the current focused listitem, such as the pvr artwork or music artwork.

***This service is removed for Matrix version

NOTE: The scripts webservice runs on tcp port 52307. This is currently hardcoded because there is no way to pass the port as a variable to the skin inside a list (which was the whole purpose of the webservice in the first place)

The following use-cases are currently supported:

PVR images inside lists

All Windows properties for the PVR-thumbs feature only provided for the current selected listitem. If you want to use them inside a panel (so you can list all channels with correct artwork), you can use the webservice:

<control type="image">
    <!--pvr thumb image-->
    <texture background="true">http://localhost:52307/getpvrthumb/?title=$ESCINFO[Listitem.Title]&amp;channel=$ESCINFO[ListItem.ChannelName]&amp;type=poster</texture>
    <visible>Skin.HasSetting(SkinHelper.EnablePVRThumbs + SubString(ListItem.FolderPath,pvr://)</visible>
</control>

The above example will return the PVR artwork, you can specify the type that should be returned with type=[kodi artwork type] You can also supply multiple arttypes by using , (comma as a seperator. In that case the script will supply the image for the first arttype found.

Optional parameter: fallback --> Allows you to set a fallback image if no image was found. For example &fallback=$ESCINFO[ListItem.Icon]

Optional parameter: year --> For more accurate results the year (or release date is passed to the TMDB lookup. For example &year=$INFO[ListItem.Year]


General thumb/image for searchphrase

You can use this to search for a general thumb using google images. For example to get a actor thumb.

<control type="image">
    <!--thumb image-->
    <texture background="true">http://localhost:52307/getthumb/?title=$ESCINFO[Listitem.Label]</texture>
</control>

The argument to pass is title which will be the searchphrase. In the above example replace $ESCINFO[Listitem.Label] with any other infolabel or text. For example inside DialogVideoInfo.xml to supply a thumb of the director:

http://localhost:52307/getthumb/?title=$ESCINFO[Listitem.Director] IMDB

Optional parameter: fallback --> Allows you to set a fallback image if no image was found. For example &fallback=DefaultDirector.png


Music Artwork

You can use this to have the music artwork inside a list/panel container.

<control type="image">
    <!--music artwork-->
    <texture background="true">http://localhost:52307/getmusicart/?artist=$ESCINFO[Listitem.Artist]&amp;track=$ESCINFO[Listitem.Title]&amp;album=$ESCINFO[Listitem.Album]&amp;type=banner,clearlogo,discart</texture>
</control>

The arguments to pass are album, track and artist. You can supply all of them or just a selection (e.g. artist+album) Possibilities are banner, clearlogo and discart for music artwork. Fanart and album thumb should be provided by Kodi itself.

Optional parameter: fallback --> Allows you to set a fallback image if no image was found. For example &fallback=$INFO[ListItem.Thumb]


Image from skin string or window property inside a panel

Normally $INFO window properties or skin string can't be used inside a container. With this little workaround you can also use them inside containers...

<control type="image">
    <!--music artwork-->
    <texture background="true">http://localhost:52307/getvarimage/?title=$INFO{MyCustomWindowProp)}</texture>
</control>

You provide the window property (or any other $INFO label as the title param. Note that you must replace the normal [] brackets with {} At the moment it is not possible to use this approach for the new resource images addons.

More info: http://trac.kodi.tv/ticket/16366

http://localhost:52307/getvarimage&amp;title=$INFO{Skin.String(MyCustomPath)}/logo.png


Genre images

You can use this to create a custom view for movie/tvshow genres with posters/fanart from the genre

poster 1 for movies in genre X:
http://localhost:52307/getmoviegenreimages/?title=$INFO[Listitem.Label]&amp;type=poster.0&amp;fallback=DefaultGenre.png

poster 1 for tvshows in genre X:
http://localhost:52307/gettvshowgenreimages/?title=$INFO[Listitem.Label]&amp;type=poster.0&amp;fallback=DefaultGenre.png


fanart 1 for movies in genre X:
http://localhost:52307/getmoviegenreimages/?title=$INFO[Listitem.Label]&amp;type=fanart.0&amp;fallback=DefaultGenre.png</texture>


fanart 1 for tvshows in genre X:
http://localhost:52307/gettvshowgenreimages/?title=$INFO[Listitem.Label]&amp;type=fanart.0&amp;fallback=DefaultGenre.png

Possible types are poster.X and fanart.X (replace X with count, only 0-4 are available) Replace getmoviegenreimages with getmoviegenreimagesrandom to have the artwork items be randomly pulled from the db instead of sorted alphabetically.

Webservice optional paramameters
  • fallback --> Allows you to set a fallback image if no image was found. For example &fallback=$INFO[ListItem.Thumb]

  • refresh --> By default the textures are cached by Kodi's texture cache which can be sticky when the underlying image was changed. Use an refresh param to force refresh. For example &refresh=$INFO[System.Time(hh)]

  • json=true --> If this parameter is given, the result will be sent as json and not as image. This comes in handy when other addons want to use the images provided by skinhelper. NOTE to addon devs: For more flexibility you should check out the Kodi module script.module.skin.helper.artutils

Generic note

If you pass variables to the webservice, prefer to use $ESCINFO instead of just $INFO so the variable will be sent within quotes. Otherwise you could get in trouble if the title contains special characters.