The ListItem

xbmcswift2 prefers to represent XBMC list items as plain python dictionaries as much as possible. Views return lists of dictionaries, where each dict represents an XBMC listitem. The list of valid keys in an item dict can always be validated by reviewing the available arguments to xbmcswift2.ListItem.from_dict(). However, we’ll go into more detail here.

Valid keys in an item dict are:


A required string. Used as the main display label for the list item.


A string. Used as the alternate display label for the list item.


A path to an icon image.


A path to a thumbnail image.


A required string.

For non-playable items, this is typically a URL for a different path in the same addon. To derive URLs for other views within your addon, use xbmcswift2.Plugin.url_for().

For playable items, this is typically a URL to a remote media file. (One exception, is if you are using the set_resolved_url pattern, the URL will be playable but will also call back into your addon.)


A boolean which will set the item as selected. False is default.


A dictionary of key/values of metadata information about the item. See the XBMC docs for a list of valid info items. Keys are always strings but values should be the correct type required by XBMC.

Also, see the related info_type key.


A dict of properties, similar to info-labels. See for more information.


A list of tuples, where each tuple is of length 2. The tuple should be (label, action) where action is a string representing a built-in XBMC function. See the XBMC documentation for more details and Using the Context Menu for some example code.


Used in conjunction with context_menu. A boolean indicating whether to replace the existing context menu with the passed context menu items. Defaults to False.


A boolean indicating whether the item dict is a playable item. False indicates that the item is a directory item. Use True when the path is a direct media URL, or a URL that calls back to your addon where set_resolved_url will be used.


Used in conjunction with info. The default value is usually configured automatically from your addon.xml. See for valid values.


A dict where each key is a stream type and each value is another dict of stream values. See for more information.

Table Of Contents

Related Topics

This Page