Hello,
I am a newby in Plugin Plex developpement.
I try to create some categories with your code but nothing works, someone can help me ?
my file : __init__.py :
####################################################################################################VIDEO_PREFIX = “/video/cfg”
NAME = “Crossfit Games 2013”
ART = ‘2013-games.png’
ICON = ‘2013-games.png’####################################################################################################
This function is initially called by the PMS framework to initialize the plugin. This includes
setting up the Plugin static instance along with the displayed artwork.
def Start():
# Initialize the plugin
Plugin.AddPrefixHandler(VIDEO_PREFIX, MainMenu, NAME, ICON, ART)
Plugin.AddViewGroup(“List”, viewMode = “List”, mediaType = “items”)# Setup the artwork associated with the plugin
MediaContainer.art = R(ART)
MediaContainer.title1 = NAME
MediaContainer.viewGroup = “List”
DirectoryItem.thumb = R(ICON)This main function will setup the displayed items.
@handler(’/video/cfg’, NAME)
def MainMenu():
dir = MediaContainer(viewMode = “List”)
dir.Append(Function(DirectoryItem(LiveMenu, “Live”)))
return dirdef LiveMenu(sender):
dir = MediaContainer(viewMode = “List”)dir.Append(Function(DirectoryItem(ChannelMenu, “Channel 1”), channel = 1))
dir.Append(Function(DirectoryItem(ChannelMenu, “Channel 2”), channel = 2))
dir.Append(Function(DirectoryItem(ChannelMenu, “Channel 3”), channel = 3))return dir
def ChannelMenu(sender, channel):
# Return video content for specific live channel
return 0