Open DialogVideoInfo.xml for a specified movie?
#5
I appreciate your willingness to help.

What I am ultimately trying to do is create a customized search results list when clicking on directors/actors (see here: https://forum.kodi.tv/showthread.php?tid=346455).

I am starting "small" by just trying to create a search for Directors.  I am using another addon, TagOverview, as my starting point and trying to repurpose the code.  
This is probably leading me astray and I should probably step back and just create a simple add on from scratch.  But using this addon has gotten me pretty far.

I am able to successfully trigger my script by clicking on the director field from my skin and create a list of all movies with the appropriate director.

This is the code that builds the list dialog:

python:
def buildList(self):
        movies = self.vdb.GetMovies()
        control=self.getControl(MOVIELIST)
        for movie in movies:
           control.addItem(self.createListItem(movie[1],movie[0]))

def createListItem(self, label, movieid):
        li = xbmcgui.ListItem(label)
        li.setProperty(PROPERTY_MOVIEID, str(movieid))
        return li

What I am trying to do now is handle the action of clicking on a specific movie.

python:
def onAction(self, action):
        if not (action.getId() == ACTION_SELECT_ITEM) or not (action.getId() == ACTION_SELECT_ITEM2):
            self.onAction1(action)  #cancels
        if (action == ACTION_SELECT_ITEM) or (action == ACTION_SELECT_ITEM2):
            controlId = self.getFocusId()
            if controlId == MOVIELIST:
                li = xbmcgui.ListItem Huh  #this is where I'm failing to properly get the ListItem.
                
                displayVideoInfo(li)
            if controlId == TAGMGMTBTN:  #legacy from tagoverview; ignore for now
                self.openTagOverview()
                self.close()

 def displayVideoInfo(self,li):
        xbmc.executebuiltin('Dialog.Close(all,true)')  #thought I needed to close out the currently opened DialogVideoInfo.xml before opening a new one
        dialog = xbmcgui.Dialog(li)
        dialog.info(li)

Looking at what examples I can find, this is probably a bad way of doing things and I should probably start from scratch.  But digging through this code has helped me learn things.  Any additional help would be appreciated but I'd also certainly understand hearing "stop what you are doing".  Smile
Maintaining a few add-ons for v18 including PseudoTV (Classic), Tag Overview, and Autosub: https://github.com/fnord12
Reply


Messages In This Thread
RE: Open DialogVideoInfo.xml for a specified movie? - by fnord12 - 2019-09-11, 00:26
Logout Mark Read Team Forum Stats Members Help
Open DialogVideoInfo.xml for a specified movie?0