Skip to content

Commit

Permalink
Add examples for setPluginCategory and setContent functions
Browse files Browse the repository at this point in the history
  • Loading branch information
romanvm committed Sep 28, 2017
1 parent 8778f4e commit a153be8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ def list_categories():
"""
Create the list of video categories in the Kodi interface.
"""
# Set plugin category. It is displayed in some skins as the name
# of the current section.
xbmcplugin.setPluginCategory(_handle, 'My Video Collection')
# Set plugin content. It allows Kodi to select appropriate views
# for this type of content.
xbmcplugin.setContent(_handle, 'videos')
# Get video categories
categories = get_categories()
# Iterate through categories
Expand Down Expand Up @@ -149,6 +155,12 @@ def list_videos(category):
:param category: Category name
:type category: str
"""
# Set plugin category. It is displayed in some skins as the name
# of the current section.
xbmcplugin.setPluginCategory(_handle, category)
# Set plugin content. It allows Kodi to select appropriate views
# for this type of content.
xbmcplugin.setContent(_handle, 'videos')
# Get the list of videos in the category.
videos = get_videos(category)
# Iterate through videos.
Expand Down

0 comments on commit a153be8

Please sign in to comment.