![]() |
Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
|
Plugin functions on Kodi. More...
Functions | |
addDirectoryItem (...) | |
addDirectoryItems (...) | |
endOfDirectory (...) | |
setResolvedUrl (...) | |
addSortMethod (...) | |
getSetting (...) | |
setSetting (...) | |
setContent (...) | |
setPluginCategory (...) | |
setPluginFanart (...) | |
setProperty (...) | |
Plugin functions on Kodi.
Offers classes and functions that allow a developer to present information through Kodi's standard menu structure. While plugins don't have the same flexibility as scripts, they boast significantly quicker development time and a more consistent user experience.
addDirectoryItem | ( | ... | ) |
Callback function to pass directory contents back to Kodi.
handle | integer - handle the plugin was started with. |
url | string - url of the entry. would be plugin:// for another virtual directory |
listitem | ListItem - item to add. |
isFolder | [opt] bool - True=folder / False=not a folder(default). |
totalItems | [opt] integer - total number of items that will be passed.(used for progressbar) |
Example:
addDirectoryItems | ( | ... | ) |
Callback function to pass directory contents back to Kodi as a list.
handle | integer - handle the plugin was started with. |
items | List - list of (url, listitem[, isFolder]) as a tuple to add. |
totalItems | [opt] integer - total number of items that will be passed.(used for progressbar) |
Example:
addSortMethod | ( | ... | ) |
Adds a sorting method for the media list.
handle | integer - handle the plugin was started with. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sortMethod | integer - see available sort methods at the bottom (or see SortFileItem.h).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label2Mask | [opt] string - the label mask to use for the second label. Defaults to %D
|
Example:
endOfDirectory | ( | ... | ) |
Callback function to tell Kodi that the end of the directory listing in a virtualPythonFolder module is reached.
handle | integer - handle the plugin was started with. |
succeeded | [opt] bool - True=script completed successfully(Default)/False=Script did not. |
updateListing | [opt] bool - True=this folder should update the current listing/False=Folder is a subfolder(Default). |
cacheToDisc | [opt] bool - True=Folder will cache if extended time(default)/False=this folder will never cache to disc. |
Example:
getSetting | ( | ... | ) |
Returns the value of a setting as a string.
handle | integer - handle the plugin was started with. |
id | string - id of the setting that the module needs to access. |
Example:
setContent | ( | ... | ) |
Sets the plugins content.
handle | integer - handle the plugin was started with. |
content | string - content type (eg. movies) |
files | songs | artists | albums |
movies | tvshows | episodes | musicvideos |
videos | images | games | – |
Example:
setPluginCategory | ( | ... | ) |
Sets the plugins name for skins to display.
handle | integer - handle the plugin was started with. |
category | string or unicode - plugins sub category. |
Example:
setPluginFanart | ( | ... | ) |
Sets the plugins fanart and color for skins to display.
handle | integer - handle the plugin was started with. |
image | [opt] string - path to fanart image. |
color1 | [opt] hexstring - color1. (e.g. '0xFFFFFFFF') |
color2 | [opt] hexstring - color2. (e.g. '0xFFFF3300') |
color3 | [opt] hexstring - color3. (e.g. '0xFF000000') |
Example:
setProperty | ( | ... | ) |
Sets a container property for this plugin.
handle | integer - handle the plugin was started with. |
key | string - property name. |
value | string or unicode - value of property. |
Example:
setResolvedUrl | ( | ... | ) |
Callback function to tell Kodi that the file plugin has been resolved to a url
handle | integer - handle the plugin was started with. |
succeeded | bool - True=script completed successfully/False=Script did not. |
listitem | ListItem - item the file plugin resolved to for playback. |
Example:
setSetting | ( | ... | ) |
Sets a plugin setting for the current running plugin.
handle | integer - handle the plugin was started with. |
id | string - id of the setting that the module needs to access. |
value | string or unicode - value of the setting. |
Example: