Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Selectable window list item. More...
Topics | |
Overlay icon types | |
Overlay icon types used on list item. | |
Classes | |
class | XBMCAddon::xbmcgui::ListItem |
Functions | |
XBMCAddon::xbmcgui::ListItem::ListItem ([label, label2, path, offscreen]) | |
Selectable window list item. | |
XBMCAddon::xbmcgui::ListItem::getLabel () | |
| |
XBMCAddon::xbmcgui::ListItem::getLabel2 () | |
| |
XBMCAddon::xbmcgui::ListItem::setLabel (...) | |
| |
XBMCAddon::xbmcgui::ListItem::setLabel2 (...) | |
| |
XBMCAddon::xbmcgui::ListItem::getDateTime () | |
| |
XBMCAddon::xbmcgui::ListItem::setDateTime (...) | |
| |
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::isFolder () | |
| |
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 (...) | |
| |
XBMCAddon::xbmcgui::ListItem::setAvailableFanart (...) | |
| |
XBMCAddon::xbmcgui::ListItem::addAvailableArtwork (...) | |
| |
XBMCAddon::xbmcgui::ListItem::addStreamInfo (...) | |
| |
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::getPath () | |
| |
XBMCAddon::xbmcgui::ListItem::getVideoInfoTag () | |
| |
XBMCAddon::xbmcgui::ListItem::getMusicInfoTag () | |
| |
XBMCAddon::xbmcgui::ListItem::getPictureInfoTag () | |
| |
XBMCAddon::xbmcgui::ListItem::getGameInfoTag () | |
| |
Selectable window list item.
void XBMCAddon::xbmcgui::ListItem::addAvailableArtwork | ( | ... | ) |
Function: addAvailableArtwork(images)
url | string (image path url) |
art_type | string (image type) |
preview | [opt] string (image preview path url) |
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) |
Example:
void XBMCAddon::xbmcgui::ListItem::addContextMenuItems | ( | ... | ) |
Function: addContextMenuItems([(label, action),*])
items | list - [(label, action),*] A list of tuples consisting of label and action pairs.
|
Example:
void XBMCAddon::xbmcgui::ListItem::addSeason | ( | ... | ) |
Function: addSeason(number, name = "")
number | int - the number of the season. |
name | string - the name of the season. Default "". |
Example:
void XBMCAddon::xbmcgui::ListItem::addStreamInfo | ( | ... | ) |
Function: addStreamInfo(type, values)
type | string - type of stream(video/audio/subtitle). |
values | dictionary - pairs of { label: value }. |
Label | Description |
---|---|
codec | string (h264) |
aspect | float (1.78) |
width | integer (1280) |
height | integer (720) |
duration | integer (seconds) |
Label | Description |
---|---|
codec | string (dts) |
language | string (en) |
channels | integer (2) |
Label | Description |
---|---|
language | string (en) |
Example:
String XBMCAddon::xbmcgui::ListItem::getArt | ( | key | ) |
Function: getArt(key)
key | string - art name.
|
Example:
String XBMCAddon::xbmcgui::ListItem::getDateTime | ( | ) |
Function: getDateTime()
Example:
xbmc::InfoTagGame * XBMCAddon::xbmcgui::ListItem::getGameInfoTag | ( | ) |
Function: getGameInfoTag()
String XBMCAddon::xbmcgui::ListItem::getLabel | ( | ) |
Function: getLabel()
Example:
String XBMCAddon::xbmcgui::ListItem::getLabel2 | ( | ) |
Function: getLabel2()
Example:
xbmc::InfoTagMusic * XBMCAddon::xbmcgui::ListItem::getMusicInfoTag | ( | ) |
Function: getMusicInfoTag()
String XBMCAddon::xbmcgui::ListItem::getPath | ( | ) |
Function: getPath()
xbmc::InfoTagPicture * XBMCAddon::xbmcgui::ListItem::getPictureInfoTag | ( | ) |
Function: getPictureInfoTag()
String XBMCAddon::xbmcgui::ListItem::getProperty | ( | ... | ) |
Function: getProperty(key)
key | string - property name. |
Example:
float XBMCAddon::xbmcgui::ListItem::getRating | ( | key | ) |
Function: getRating(key)
key | string - rating type.
|
Example:
String XBMCAddon::xbmcgui::ListItem::getUniqueID | ( | key | ) |
Function: getUniqueID(key)
key | string - uniqueID name.
|
Example:
xbmc::InfoTagVideo * XBMCAddon::xbmcgui::ListItem::getVideoInfoTag | ( | ) |
Function: getVideoInfoTag()
int XBMCAddon::xbmcgui::ListItem::getVotes | ( | key | ) |
Function: getVotes(key)
key | string - rating type.
|
Example:
bool XBMCAddon::xbmcgui::ListItem::isFolder | ( | ) |
Function: isFolder()
Example:
bool XBMCAddon::xbmcgui::ListItem::isSelected | ( | ) |
Function: isSelected()
Example:
XBMCAddon::xbmcgui::ListItem::ListItem | ( | ) |
Selectable window list item.
The list item control is used for creating item lists in Kodi
Class: ListItem([label, label2, path, offscreen])
label | [opt] string (default "" ) - the label to display on the item |
label2 | [opt] string (default "" ) - the label2 of the item |
path | [opt] string (default "" ) - the path for the item |
offscreen | [opt] bool (default False ) - if GUI based locks should be avoided. Most of the times listitems are created offscreen and added later to a container for display (e.g. plugins) or they are not even displayed (e.g. python scrapers). In such cases, there is no need to lock the GUI when creating the items (increasing your addon performance). Note however, that if you are creating listitems and managing the container itself (e.g using WindowXML or WindowXMLDialog classes) subsquent modifications to the item will require locking. Thus, in such cases, use the default value (False ). |
Example:
void XBMCAddon::xbmcgui::ListItem::select | ( | ... | ) |
Function: select(selected)
selected | bool - True=selected/False=not selected |
Example:
void XBMCAddon::xbmcgui::ListItem::setArt | ( | ... | ) |
Function: setArt(values)
values | dictionary - pairs of { label: value } .
|
Example:
void XBMCAddon::xbmcgui::ListItem::setAvailableFanart | ( | ... | ) |
Function: setAvailableFanart(images)
images | list of dictionaries (see below for relevant keys) |
Label | Description |
---|---|
image | string (http://www.someurl.com/someimage.png) |
preview | [opt] string (http://www.someurl.com/somepreviewimage.png) |
Example:
void XBMCAddon::xbmcgui::ListItem::setCast | ( | ... | ) |
Function: setCast(actors)
actors | list of dictionaries (see below for relevant keys) |
Label | Description |
---|---|
name | string (Michael C. Hall) |
role | string (Dexter) |
thumbnail | string (http://www.someurl.com/someimage.png) |
order | integer (1) |
Example:
void XBMCAddon::xbmcgui::ListItem::setContentLookup | ( | ... | ) |
Function: setContentLookup(enable)
If disabled, HEAD requests to e.g determine mime type will not be sent.
enable | bool to enable content lookup |
void XBMCAddon::xbmcgui::ListItem::setDateTime | ( | ... | ) |
Function: setDateTime(dateTime)
label | string or unicode - datetime string (W3C). |
Example:
void XBMCAddon::xbmcgui::ListItem::setInfo | ( | ... | ) |
Function: setInfo(type, infoLabels)
type | string - type of info labels |
infoLabels | dictionary - pairs of { label: value } |
Available types
Command name | Description |
---|---|
video | Video information |
music | Music information |
pictures | Pictures informanion |
game | Game information |
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.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 | deprecated - 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 |
videoversion | string (Video version) |
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) |
Example:
void XBMCAddon::xbmcgui::ListItem::setIsFolder | ( | ... | ) |
Function: setIsFolder(isFolder)
isFolder | bool - True=folder / False=not a folder (default). |
Example:
void XBMCAddon::xbmcgui::ListItem::setLabel | ( | ... | ) |
Function: setLabel(label)
label | string or unicode - text string. |
Example:
void XBMCAddon::xbmcgui::ListItem::setLabel2 | ( | ... | ) |
Function: setLabel2(label)
label | string or unicode - text string. |
Example:
void XBMCAddon::xbmcgui::ListItem::setMimeType | ( | ... | ) |
Function: setMimeType(mimetype)
mimetype | string 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.
void XBMCAddon::xbmcgui::ListItem::setPath | ( | ... | ) |
Function: setPath(path)
path | string or unicode - path, activated when item is clicked. |
Example:
void XBMCAddon::xbmcgui::ListItem::setProperties | ( | ... | ) |
Function: setProperties(values)
values | dictionary - pairs of { label: value } . |
Example:
void XBMCAddon::xbmcgui::ListItem::setProperty | ( | ... | ) |
Function: setProperty(key, value)
key | string - property name. |
value | string or unicode - value of property. |
Key | Description |
---|---|
inputstream | string (inputstream.adaptive) - Set the inputstream add-on that will be used to play the item |
IsPlayable | string - "true", "false" - Mark the item as playable, mandatory for playable items |
MimeType | string (application/x-mpegURL) - Set the MimeType of the item before playback |
ResumeTime | float (1962.0) - Set the resume point of the item in seconds |
SpecialSort | string - "top", "bottom" - The item will remain at the top or bottom of the current list |
StartOffset | float (60.0) - Set the offset in seconds at which to start playback of the item |
StartPercent | float (15.0) - Set the percentage at which to start playback of the item |
StationName | string ("My Station Name") - Used to enforce/override MusicPlayer.StationName infolabel from addons (e.g. in radio addons) |
TotalTime | float (7848.0) - Set the total time of the item in seconds |
OverrideInfotag | string - "true", "false" - When true will override all info from previous listitem |
ForceResolvePlugin | string - "true", "false" - When true ensures that a plugin will always receive callbacks to resolve paths (useful for playlist cases) |
rtsp_transport | string - "udp", "udp_multicast" or "tcp" - Allow to force the rtsp transport mode for rtsp streams |
OverrideInfotag property added
ResumeTime and TotalTime deprecated. Use InfoTagVideo.setResumePoint() instead.
ForceResolvePlugin property added
rtsp_transport property added
Example:
void XBMCAddon::xbmcgui::ListItem::setRating | ( | ... | ) |
Function: setRating(type, rating, votes = 0, defaultt = False)
type | string - the type of the rating. Any string. | ||||||||||
rating | float - the value of the rating. | ||||||||||
votes | int - the number of votes. Default 0. | ||||||||||
defaultt | bool - is the default rating?. Default False.
|
Example:
void XBMCAddon::xbmcgui::ListItem::setSubtitles | ( | ... | ) |
Function: setSubtitles(subtitleFiles)
subtitleFiles | list with path to subtitle files |
Example:
void XBMCAddon::xbmcgui::ListItem::setUniqueIDs | ( | ... | ) |
Function: setUniqueIDs(values, defaultrating)
values | dictionary - pairs of { label: value } . |
defaultrating | [opt] string - the name of default rating. |
Label | Type |
---|---|
imdb | string - uniqueid name |
tvdb | string - uniqueid name |
tmdb | string - uniqueid name |
anidb | string - uniqueid name |
Example: