HI,
I’m writing a channel and I noticed the the handler method is called multiple times while traversing the directory tree of the channel.
I checked with chrome network monitoring via the plex web ui and indeed there are calls to the prefix url clicking on DirectoryObjects and VideoClipObjects in addition to the actual calls.
From what I read in the documentation that is not the expected behavior.
This is essentially my code
@handler(PREFIX, TITLE)
def MainMenu():
Log.Debug('MainMenu')
oc = ObjectContainer()
oc.add(DirectoryObject(
key=Callback(Category, id='1'),
title='abc'
))
@route(PREFIX + '/category/{id}')
def Category(id):
oc = ObjectContainer(title1=L('name'))
oc.add(DirectoryObject(
key=Callback(Category, id='2'),
title='dfg'
))
return oc
Looking in the plugin logs I can see the MainMenu entry after clicking the DirectoryObject ‘abc’ and even after clicking on the DirectoryObject ‘dfg’.
Am I missing something? should the handler be called for every link in the page?
thanks