|
Kodi Docs 20.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 | ( | ... | ) |
Function: xbmcplugin.addDirectoryItem(handle, url, listitem [,isFolder, totalItems]) | 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 | ( | ... | ) |
Function: xbmcplugin.addDirectoryItems(handle, items[, totalItems]) | 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 SortUtils).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labelMask | [opt] string - the label mask to use for the first label.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label2Mask | [opt] string - the label mask to use for the second label. Defaults to %D
|
Example:
| endOfDirectory | ( | ... | ) |
Function: xbmcplugin.endOfDirectory(handle[, succeeded, updateListing, cacheToDisc]) | 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 | ( | ... | ) |
Function: xbmcplugin.getSetting(handle, id) | handle | integer - handle the plugin was started with. |
| id | string - id of the setting that the module needs to access. |
Example:
| setContent | ( | ... | ) |
Function: xbmcplugin.setContent(handle, 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 | ( | ... | ) |
Function: xbmcplugin.setPluginCategory(handle, category) | handle | integer - handle the plugin was started with. |
| category | string or unicode - plugins sub category. |
Example:
| setPluginFanart | ( | ... | ) |
Function: xbmcplugin.setPluginFanart(handle, image, color1, color2, color3) | 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 | ( | ... | ) |
Function: xbmcplugin.setProperty(handle, key, value) | handle | integer - handle the plugin was started with. |
| key | string - property name. |
| value | string or unicode - value of property. |
Example:
| setResolvedUrl | ( | ... | ) |
Function: xbmcplugin.setResolvedUrl(handle, succeeded, listitem) | 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 | ( | ... | ) |
Function: xbmcplugin.setSetting(handle, id, value) | 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: