Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.

Selectable window list item. More...

Modules

 Overlay icon types
 Overlay icon types used on list item.
 

Classes

class  XBMCAddon::xbmcgui::ListItem
 

Functions

 XBMCAddon::xbmcgui::ListItem::ListItem (const String &label=emptyString, const String &label2=emptyString, const String &iconImage=emptyString, const String &thumbnailImage=emptyString, const String &path=emptyString, bool offscreen=false)
 
 XBMCAddon::xbmcgui::ListItem::~ListItem () override
 
 XBMCAddon::xbmcgui::ListItem::getLabel ()
 
 XBMCAddon::xbmcgui::ListItem::getLabel2 ()
 
 XBMCAddon::xbmcgui::ListItem::setLabel (...)
 
 XBMCAddon::xbmcgui::ListItem::setLabel2 (...)
 
 XBMCAddon::xbmcgui::ListItem::setIconImage (...)
 
 XBMCAddon::xbmcgui::ListItem::setThumbnailImage (...)
 
 XBMCAddon::xbmcgui::ListItem::setArt (...)
 
 XBMCAddon::xbmcgui::ListItem::setIsFolder (...)
 
 XBMCAddon::xbmcgui::ListItem::setUniqueIDs (...)
 
 XBMCAddon::xbmcgui::ListItem::setRating (...)
 
 XBMCAddon::xbmcgui::ListItem::addSeason (...)
 
 XBMCAddon::xbmcgui::ListItem::getArt (key)
 
 XBMCAddon::xbmcgui::ListItem::getUniqueID (key)
 
 XBMCAddon::xbmcgui::ListItem::getRating (key)
 
 XBMCAddon::xbmcgui::ListItem::getVotes (key)
 
 XBMCAddon::xbmcgui::ListItem::select (...)
 
 XBMCAddon::xbmcgui::ListItem::isSelected ()
 
 XBMCAddon::xbmcgui::ListItem::setInfo (...)
 
 XBMCAddon::xbmcgui::ListItem::setCast (...)
 Set cast including thumbnails. More...
 
 XBMCAddon::xbmcgui::ListItem::setAvailableFanart (...)
 Set available images (needed for video scrapers) More...
 
 XBMCAddon::xbmcgui::ListItem::addAvailableArtwork (...)
 Add an image to available artworks (needed for video scrapers) More...
 
 XBMCAddon::xbmcgui::ListItem::addStreamInfo (...)
 Add a stream with details. More...
 
 XBMCAddon::xbmcgui::ListItem::addContextMenuItems (...)
 
 XBMCAddon::xbmcgui::ListItem::setProperty (...)
 
 XBMCAddon::xbmcgui::ListItem::setProperties (...)
 
 XBMCAddon::xbmcgui::ListItem::getProperty (...)
 
 XBMCAddon::xbmcgui::ListItem::setPath (...)
 
 XBMCAddon::xbmcgui::ListItem::setMimeType (...)
 
 XBMCAddon::xbmcgui::ListItem::setContentLookup (...)
 
 XBMCAddon::xbmcgui::ListItem::setSubtitles (...)
 
 XBMCAddon::xbmcgui::ListItem::getdescription ()
 
 XBMCAddon::xbmcgui::ListItem::getduration ()
 
 XBMCAddon::xbmcgui::ListItem::getfilename ()
 
 XBMCAddon::xbmcgui::ListItem::getPath ()
 
 XBMCAddon::xbmcgui::ListItem::getVideoInfoTag ()
 
 XBMCAddon::xbmcgui::ListItem::getMusicInfoTag ()
 

Detailed Description

Selectable window list item.

The list item control is used for creating item lists in Kodi

Class: ListItem([label, label2, iconImage, thumbnailImage, path])

Parameters
label[opt] string
label2[opt] string
iconImageDeprecated. Use setArt
thumbnailImageDeprecated. Use setArt
path[opt] string

v16 Python API changes:
iconImage and thumbnailImage are deprecated. Use setArt().

Example:

...
listitem = xbmcgui.ListItem('Casino Royale')
...

Function Documentation

◆ addAvailableArtwork()

void XBMCAddon::xbmcgui::ListItem::addAvailableArtwork (   ...)

Add an image to available artworks (needed for video scrapers)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> addAvailableArtwork(images) </big></font></span></code></h4> \endhtmlonly

Parameters
urlstring (image path url)
art_typestring (image type)
referrer[opt] string (referrer url)
cache[opt] string (filename in cache)
post[opt] bool (use post to retrieve the image, default false)
isgz[opt] bool (use gzip to retrieve the image, default false)
season[opt] integer (number of season in case of season thumb)

v18 Python API changes:
New function added.

Example:

...
listitem.addAvailableArtwork(path_to_image_1, "thumb")
...

◆ addContextMenuItems()

void XBMCAddon::xbmcgui::ListItem::addContextMenuItems (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> addContextMenuItems([(label, action),*]) </big></font></span></code></h4> \endhtmlonly

Adds item(s) to the context menu for media lists.

Parameters
itemslist - [(label, action),*] A list of tuples consisting of label and action pairs.
  • label string or unicode - item's label.
  • action string or unicode - any available built-in function .
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.

v17 Python API changes:
Completely removed previously available argument replaceItems.

Example:

...
listitem.addContextMenuItems([('Theater Showtimes', 'RunScript(special://home/scripts/showtimes/default.py,Iron Man)')])
...

◆ addSeason()

void XBMCAddon::xbmcgui::ListItem::addSeason (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> addSeason(number, name = "") </big></font></span></code></h4> \endhtmlonly

Add a season with name to a listitem. It needs at least the season number

Parameters
numberint - the number of the season.
namestring - the name of the season. Default "".

v18 Python API changes:
New function added.

Example:

...
# addSeason(number, name))
listitem.addSeason(1, "Murder House")
...

◆ addStreamInfo()

void XBMCAddon::xbmcgui::ListItem::addStreamInfo (   ...)

Add a stream with details.

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> addStreamInfo(type, values) </big></font></span></code></h4> \endhtmlonly

Parameters
typestring - type of stream(video/audio/subtitle).
valuesdictionary - pairs of { label: value }.
  • Video Values:
    Label Description
    codec string (h264)
    aspect float (1.78)
    width integer (1280)
    height integer (720)
    duration integer (seconds)
  • Audio Values:
    Label Description
    codec string (dts)
    language string (en)
    channels integer (2)
  • Subtitle Values:
    Label Description
    language string (en)

Example:

...
listitem.addStreamInfo('video', { 'codec': 'h264', 'width' : 1280 })
...

◆ getArt()

String XBMCAddon::xbmcgui::ListItem::getArt ( key  )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getArt(key) </big></font></span></code></h4> \endhtmlonly

Returns a listitem art path as a string, similar to an infolabel.

Parameters
keystring - art name.
  • Some default art values (any string possible):
    Label Type
    thumb string - image path
    poster string - image path
    banner string - image path
    fanart string - image path
    clearart string - image path
    clearlogo string - image path
    landscape string - image path
    icon string - image path

v17 Python API changes:
New function added.

Example:

...
poster = listitem.getArt('poster')
...

◆ getdescription()

String XBMCAddon::xbmcgui::ListItem::getdescription ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getdescription() </big></font></span></code></h4> \endhtmlonly

v17 Python API changes:
Deprecated.

◆ getduration()

String XBMCAddon::xbmcgui::ListItem::getduration ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getduration() </big></font></span></code></h4> \endhtmlonly

v17 Python API changes:
Deprecated. Use InfoTagMusic.

◆ getfilename()

String XBMCAddon::xbmcgui::ListItem::getfilename ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getfilename() </big></font></span></code></h4> \endhtmlonly

v17 Python API changes:
Deprecated.

◆ getLabel()

String XBMCAddon::xbmcgui::ListItem::getLabel ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getLabel() </big></font></span></code></h4> \endhtmlonly

Returns the listitem label.

Returns
Label of item

Example:

...
# getLabel()
label = listitem.getLabel()
...

◆ getLabel2()

String XBMCAddon::xbmcgui::ListItem::getLabel2 ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getLabel2() </big></font></span></code></h4> \endhtmlonly

Returns the second listitem label.

Returns
Second label of item

Example:

...
# getLabel2()
label = listitem.getLabel2()
...

◆ getMusicInfoTag()

xbmc::InfoTagMusic * XBMCAddon::xbmcgui::ListItem::getMusicInfoTag ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getMusicInfoTag() </big></font></span></code></h4> \endhtmlonly

Returns the MusicInfoTag for this item.

Returns
music info tag

v15 Python API changes:
New function added.

◆ getPath()

String XBMCAddon::xbmcgui::ListItem::getPath ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getPath() </big></font></span></code></h4> \endhtmlonly

Returns the path of this listitem.

Returns
[string] filename

v17 Python API changes:
New function added.

◆ getProperty()

String XBMCAddon::xbmcgui::ListItem::getProperty (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getProperty(key) </big></font></span></code></h4> \endhtmlonly

Returns a listitem property as a string, similar to an infolabel.

Parameters
keystring - property name.
Note
Key is NOT case sensitive.
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.

Example:

...
AspectRatio = listitem.getProperty('AspectRatio')
...

◆ getRating()

float XBMCAddon::xbmcgui::ListItem::getRating ( key  )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getRating(key) </big></font></span></code></h4> \endhtmlonly

Returns a listitem rating as a float.

Parameters
keystring - rating type.
  • Some default key values (any string possible):
    Label Type
    imdb string - type name
    tvdb string - type name
    tmdb string - type name
    anidb string - type name

Example:

...
rating = listitem.getRating('imdb')
...

◆ getUniqueID()

String XBMCAddon::xbmcgui::ListItem::getUniqueID ( key  )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getUniqueID(key) </big></font></span></code></h4> \endhtmlonly

Returns a listitem uniqueID as a string, similar to an infolabel.

Parameters
keystring - uniqueID name.
  • Some default uniqueID values (any string possible):
    Label Type
    imdb string - uniqueid name
    tvdb string - uniqueid name
    tmdb string - uniqueid name
    anidb string - uniqueid name

Example:

...
uniqueID = listitem.getUniqueID('imdb')
...

◆ getVideoInfoTag()

xbmc::InfoTagVideo * XBMCAddon::xbmcgui::ListItem::getVideoInfoTag ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getVideoInfoTag() </big></font></span></code></h4> \endhtmlonly

Returns the VideoInfoTag for this item.

Returns
video info tag

v15 Python API changes:
New function added.

◆ getVotes()

int XBMCAddon::xbmcgui::ListItem::getVotes ( key  )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> getVotes(key) </big></font></span></code></h4> \endhtmlonly

Returns a listitem votes as a integer.

Parameters
keystring - rating type.
  • Some default key values (any string possible):
    Label Type
    imdb string - type name
    tvdb string - type name
    tmdb string - type name
    anidb string - type name

Example:

...
votes = listitem.getVotes('imdb')
...

◆ isSelected()

bool XBMCAddon::xbmcgui::ListItem::isSelected ( )

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> isSelected() </big></font></span></code></h4> \endhtmlonly

Returns the listitem's selected status.

Returns
bool - true if selected, otherwise false

Example:

...
# isSelected()
selected = listitem.isSelected()
...

◆ ListItem()

XBMCAddon::xbmcgui::ListItem::ListItem ( const String label = emptyString,
const String label2 = emptyString,
const String iconImage = emptyString,
const String thumbnailImage = emptyString,
const String path = emptyString,
bool  offscreen = false 
)

◆ select()

void XBMCAddon::xbmcgui::ListItem::select (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> select(selected) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's selected status.

Parameters
selectedbool - True=selected/False=not selected

Example:

...
# select(selected)
listitem.select(True)
...

◆ setArt()

void XBMCAddon::xbmcgui::ListItem::setArt (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setArt(values) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's art

Parameters
valuesdictionary - pairs of { label: value }.
  • Some default art values (any string possible):
    Label Type
    thumb string - image filename
    poster string - image filename
    banner string - image filename
    fanart string - image filename
    clearart string - image filename
    clearlogo string - image filename
    landscape string - image filename
    icon string - image filename

v13 Python API changes:
New function added.
v16 Python API changes:
Added new label icon.

Example:

...
# setArt(values)
listitem.setArt({ 'poster': 'poster.png', 'banner' : 'banner.png' })
...

◆ setAvailableFanart()

void XBMCAddon::xbmcgui::ListItem::setAvailableFanart (   ...)

Set available images (needed for video scrapers)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setAvailableFanart(images) </big></font></span></code></h4> \endhtmlonly

Parameters
imageslist of dictionaries (see below for relevant keys)

v18 Python API changes:
New function added.

Example:

...
fanart = [{"image": path_to_image_1, "preview": path_to_preview_1}, {"image": path_to_image_2, "preview": path_to_preview_2}]
listitem.setAvailableFanart(fanart)
...

◆ setCast()

void XBMCAddon::xbmcgui::ListItem::setCast (   ...)

Set cast including thumbnails.

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setCast(actors) </big></font></span></code></h4> \endhtmlonly

Parameters
actorslist of dictionaries (see below for relevant keys)

v17 Python API changes:
New function added.

Example:

...
actors = [{"name": "Actor 1", "role": "role 1"}, {"name": "Actor 2", "role": "role 2"}]
listitem.setCast(actors)
...

◆ setContentLookup()

void XBMCAddon::xbmcgui::ListItem::setContentLookup (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setContentLookup(enable) </big></font></span></code></h4> \endhtmlonly

Enable or disable content lookup for item.

If disabled, HEAD requests to e.g determine mime type will not be sent.

Parameters
enablebool to enable content lookup

v16 Python API changes:
New function added.

◆ setIconImage()

void XBMCAddon::xbmcgui::ListItem::setIconImage (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setIconImage(iconImage) </big></font></span></code></h4> \endhtmlonly

v16 Python API changes:
Deprecated. Use setArt().

◆ setInfo()

void XBMCAddon::xbmcgui::ListItem::setInfo (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setInfo(type, infoLabels) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's infoLabels.

Parameters
typestring - type of
infoLabelsdictionary - pairs of { label: value }

Available types

Command name Description
video Video information
music Music information
pictures Pictures informanion
game Game information
Note
To set pictures exif info, prepend exif: to the label. Exif values must be passed as strings, separate value pairs with a comma. (eg. {'exif:resolution': '720,480'} See kodi_pictures_infotag for valid strings.

You can use the above as keywords for arguments and skip certain optional arguments. Once you use a keyword, all following arguments require the keyword.

General Values (that apply to all types):

Info label Description
count integer (12) - can be used to store an id for later, or for sorting purposes
size long (1024) - size in bytes
date string (d.m.Y / 01.01.2009) - file date

Video Values:

Info label Description
genre string (Comedy) or list of strings (["Comedy", "Animation", "Drama"])
country string (Germany) or list of strings (["Germany", "Italy", "France"])
year integer (2009)
episode integer (4)
season integer (1)
sortepisode integer (4)
sortseason integer (1)
episodeguide string (Episode guide)
showlink string (Battlestar Galactica) or list of strings (["Battlestar Galactica", "Caprica"])
top250 integer (192)
setid integer (14)
tracknumber integer (3)
rating float (6.4) - range is 0..10
userrating integer (9) - range is 1..10 (0 to reset)
watched depreciated - use playcount instead
playcount integer (2) - number of times this item has been played
overlay integer (2) - range is 0..7. See Overlay icon types for values
cast list (["Michal C. Hall","Jennifer Carpenter"]) - if provided a list of tuples cast will be interpreted as castandrole
castandrole list of tuples ([("Michael C. Hall","Dexter"),("Jennifer Carpenter","Debra")])
director string (Dagur Kari) or list of strings (["Dagur Kari", "Quentin Tarantino", "Chrstopher Nolan"])
mpaa string (PG-13)
plot string (Long Description)
plotoutline string (Short Description)
title string (Big Fan)
originaltitle string (Big Fan)
sorttitle string (Big Fan)
duration integer (245) - duration in seconds
studio string (Warner Bros.) or list of strings (["Warner Bros.", "Disney", "Paramount"])
tagline string (An awesome movie) - short description of movie
writer string (Robert D. Siegel) or list of strings (["Robert D. Siegel", "Jonathan Nolan", "J.K. Rowling"])
tvshowtitle string (Heroes)
premiered string (2005-03-04)
status string (Continuing) - status of a TVshow
set string (Batman Collection) - name of the collection
setoverview string (All Batman movies) - overview of the collection
tag string (cult) or list of strings (["cult", "documentary", "best movies"]) - movie tag
imdbnumber string (tt0110293) - IMDb code
code string (101) - Production code
aired string (2008-12-07)
credits string (Andy Kaufman) or list of strings (["Dagur Kari", "Quentin Tarantino", "Chrstopher Nolan"]) - writing credits
lastplayed string (Y-m-d h:m:s = 2009-04-05 23:16:04)
album string (The Joshua Tree)
artist list (['U2'])
votes string (12345 votes)
path string (/home/user/movie.avi)
trailer string (/home/user/trailer.avi)
dateadded string (Y-m-d h:m:s = 2009-04-05 23:16:04)
mediatype string - "video", "movie", "tvshow", "season", "episode" or "musicvideo"
dbid integer (23) - Only add this for items which are part of the local db. You also need to set the correct 'mediatype'!

Music Values:

Info label Description
tracknumber integer (8)
discnumber integer (2)
duration integer (245) - duration in seconds
year integer (1998)
genre string (Rock)
album string (Pulse)
artist string (Muse)
title string (American Pie)
rating float - range is between 0 and 10
userrating integer - range is 1..10
lyrics string (On a dark desert highway...)
playcount integer (2) - number of times this item has been played
lastplayed string (Y-m-d h:m:s = 2009-04-05 23:16:04)
mediatype string - "music", "song", "album", "artist"
dbid integer (23) - Only add this for items which are part of the local db. You also need to set the correct 'mediatype'!
listeners integer (25614)
musicbrainztrackid string (cd1de9af-0b71-4503-9f96-9f5efe27923c)
musicbrainzartistid string (d87e52c5-bb8d-4da8-b941-9f4928627dc8)
musicbrainzalbumid string (24944755-2f68-3778-974e-f572a9e30108)
musicbrainzalbumartistid string (d87e52c5-bb8d-4da8-b941-9f4928627dc8)
comment string (This is a great song)

Picture Values:

Info label Description
title string (In the last summer-1)
picturepath string (/home/username/pictures/img001.jpg)
exif* string (See kodi_pictures_infotag for valid strings)

Game Values:

Info label Description
title string (Super Mario Bros.)
platform string (Atari 2600)
genres list (["Action","Strategy"])
publisher string (Nintendo)
developer string (Square)
overview string (Long Description)
year integer (1980)
gameclient string (game.libretro.fceumm)

v14 Python API changes:
Added new label discnumber.
v15 Python API changes:
duration has to be set in seconds.
v16 Python API changes:
Added new label mediatype.
v17 Python API changes:
Added labels setid, set, imdbnumber, code, dbid (video), path and userrating. Expanded the possible infoLabels for the option mediatype.
v18 Python API changes:
Added new game type and associated infolabels. Added labels dbid (music), setoverview, tag, sortepisode, sortseason, episodeguide, showlink. Extended labels genre, country, director, studio, writer, tag, credits to also use a list of strings.

Example:

...
listitem.setInfo('video', { 'genre': 'Comedy' })
...
Todo:
add the rest of the infolabels

◆ setIsFolder()

void XBMCAddon::xbmcgui::ListItem::setIsFolder (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setIsFolder(isFolder) </big></font></span></code></h4> \endhtmlonly

Sets if this listitem is a folder.

Parameters
isFolderbool - True=folder / False=not a folder (default).

v18 Python API changes:
New function added.

Example:

...
# setIsFolder(isFolder)
listitem.setIsFolder(True)
...

◆ setLabel()

void XBMCAddon::xbmcgui::ListItem::setLabel (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setLabel(label) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's label.

Parameters
labelstring or unicode - text string.

Example:

...
# setLabel(label)
listitem.setLabel('Casino Royale')
...

◆ setLabel2()

void XBMCAddon::xbmcgui::ListItem::setLabel2 (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setLabel2(label) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's label2.

Parameters
labelstring or unicode - text string.

Example:

...
# setLabel2(label)
listitem.setLabel2('Casino Royale')
...

◆ setMimeType()

void XBMCAddon::xbmcgui::ListItem::setMimeType (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setMimeType(mimetype) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's mimetype if known.

Parameters
mimetypestring or unicode - mimetype

If known prehand, this can (but does not have to) avoid HEAD requests being sent to HTTP servers to figure out file type.

◆ setPath()

void XBMCAddon::xbmcgui::ListItem::setPath (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setPath(path) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's path.

Parameters
pathstring or unicode - path, activated when item is clicked.
Note
You can use the above as keywords for arguments.

Example:

...
listitem.setPath(path='/path/to/some/file.ext')
...

◆ setProperties()

void XBMCAddon::xbmcgui::ListItem::setProperties (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setProperties(values) </big></font></span></code></h4> \endhtmlonly

Sets multiple properties for listitem's

Parameters
valuesdictionary - pairs of { label: value }.
v18 Python API changes:
New function added.

Example:

...
# setProperties(values)
listitem.setProperties({ 'AspectRatio': '1.85', 'StartOffset' : '256.4' })
...

◆ setProperty()

void XBMCAddon::xbmcgui::ListItem::setProperty (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setProperty(key, value) </big></font></span></code></h4> \endhtmlonly

Sets a listitem property, similar to an infolabel.

Parameters
keystring - property name.
valuestring or unicode - value of property.
Note
Key is NOT case sensitive.
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.

Some of these are treated internally by Kodi, such as the 'StartOffset' property, which is the offset in seconds at which to start playback of an item. Others may be used in the skin to add extra information, such as 'WatchedCount' for tvshow items

Example:

...
listitem.setProperty('AspectRatio', '1.85 : 1')
listitem.setProperty('StartOffset', '256.4')
...

◆ setRating()

void XBMCAddon::xbmcgui::ListItem::setRating (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setRating(type, rating, votes = 0, defaultt = False) </big></font></span></code></h4> \endhtmlonly

Sets a listitem's rating. It needs at least type and rating param

Parameters
typestring - the type of the rating. Any string.
ratingfloat - the value of the rating.
votesint - the number of votes. Default 0.
defaulttbool - is the default rating?. Default False.
  • Some example type (any string possible):
    Label Type
    imdb string - rating type
    tvdb string - rating type
    tmdb string - rating type
    anidb string - rating type

Example:

...
# setRating(type, rating, votes, defaultt))
listitem.setRating("imdb", 4.6, 8940, True)
...

◆ setSubtitles()

void XBMCAddon::xbmcgui::ListItem::setSubtitles (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setSubtitles(subtitleFiles) </big></font></span></code></h4> \endhtmlonly

Sets subtitles for this listitem.

Parameters
subtitleFileslist with path to subtitle files

Example:

@code{py}

... listitem.setSubtitles(['special://temp/example.srt', 'http://example.com/example.srt']) ...

v14 Python API changes:
New function added.

◆ setThumbnailImage()

void XBMCAddon::xbmcgui::ListItem::setThumbnailImage (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setThumbnailImage(thumbFilename) </big></font></span></code></h4> \endhtmlonly

v16 Python API changes:
Deprecated. Use setArt().

◆ setUniqueIDs()

void XBMCAddon::xbmcgui::ListItem::setUniqueIDs (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> setUniqueIDs(values, defaultrating) </big></font></span></code></h4> \endhtmlonly

Sets the listitem's uniqueID

Parameters
valuesdictionary - pairs of { label: value }.
defaultrating[opt] string - the name of default rating.
  • Some example values (any string possible):
    Label Type
    imdb string - uniqueid name
    tvdb string - uniqueid name
    tmdb string - uniqueid name
    anidb string - uniqueid name

Example:

...
# setUniqueIDs(values, defaultrating)
listitem.setUniqueIDs({ 'imdb': 'tt8938399', 'tmdb' : '9837493' }, "imdb")
...

◆ ~ListItem()

XBMCAddon::xbmcgui::ListItem::~ListItem ( )
override