def viewBA(self): oInputParameterHandler = cInputParameterHandler() sFileName = oInputParameterHandler.getValue('sFileName') from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SearchBA()
def viewBA(self): oInputParameterHandler = cInputParameterHandler() sFileName = oInputParameterHandler.getValue('sFileName') sYear = oInputParameterHandler.getValue('sYear') sTrailerUrl = oInputParameterHandler.getValue('sTrailerUrl') sMeta = oInputParameterHandler.getValue('sMeta') from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SetYear(sYear) cBA.SetTrailerUrl(sTrailerUrl) cBA.SetMetaType(sMeta) cBA.SearchBA()
def onClick(self, controlId): if controlId == 5: self.getControl(400).setVisible(False) self.getControl(50).setVisible(True) return elif controlId == 20: self.getControl(50).setVisible(False) self.getControl(400).setVisible(True) return elif controlId == 11: from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SearchBA() self.close() return elif controlId == 30: self.close() return elif controlId == 50: #print self.getControl(50).ListItem.Property('id') item = self.getControl(50).getSelectedItem() sid = item.getProperty('id') self.credit(sid) #self.getControl(50).setVisible(True) elif controlId == 5200: #click sur un film acteur import sys from resources.lib.util import cUtil item = self.getControl(5200).getSelectedItem() sTitle = item.getLabel() try: sTitle = sTitle.encode("utf-8") sTitle = cUtil().CleanName(sTitle) except: return sTest = '%s?site=globalSearch&searchtext=%s&sCat=1' % ( sys.argv[0], sTitle) xbmc.executebuiltin('XBMC.Container.Update(%s)' % sTest) self.close() return
def onClick(self, controlId): if controlId == 5: self.getControl(400).setVisible(False) self.getControl(50).setVisible(True) return elif controlId == 20: self.getControl(50).setVisible(False) self.getControl(400).setVisible(True) return elif controlId == 11: from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SearchBA() self.close() return elif controlId == 30: self.close() return
def onClick(self, controlId): print(controlId) if controlId == 5: self.getControl(400).setVisible(False) self.getControl(50).setVisible(True) self.setFocusId(20) return elif controlId == 20: self.getControl(50).setVisible(False) self.getControl(400).setVisible(True) self.setFocusId(5) return elif controlId == 7: self.getControl(50).setVisible(True) self.setFocusId(50) return elif controlId == 11: from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SearchBA() self.close() return elif controlId == 30: self.close() return elif controlId == 50: # print(self.getControl(50).ListItem.Property('id')) item = self.getControl(50).getSelectedItem() sid = item.getProperty('id') grab = cTMDb() sUrl = 'person/' + str(sid) + '/movie_credits' try: meta = grab.getUrl(sUrl) meta = meta['cast'] self.credit(meta) except: return # self.getControl(50).setVisible(True) # click sur similaire elif controlId == 9: # print(self.getControl(9000).ListItem.tmdb_id) sid = window(10000).getProperty('ListItem.tmdb_id') grab = cTMDb() sUrl = 'movie/%s/similar' % str(sid) try: meta = grab.getUrl(sUrl) meta = meta['results'] if meta: self.credit(meta) else: self.getControl(9).setLabel('Aucune Information') except: return # click sur recommendations elif controlId == 13: # print(self.getControl(9000).ListItem.tmdb_id) sid = window(10000).getProperty('ListItem.tmdb_id') grab = cTMDb() sUrl = 'movie/%s/recommendations' % str(sid) try: meta = grab.getUrl(sUrl) meta = meta['results'] if meta: self.credit(meta) else: self.getControl(13).setLabel('Aucune Information') except: return elif controlId == 5200: # click sur un film acteur import sys from resources.lib.util import cUtil item = self.getControl(5200).getSelectedItem() sTitle = item.getLabel() try: sTitle = sTitle.encode('utf-8') sTitle = cUtil().CleanName(sTitle) except: return sTest = '%s?site=globalSearch&searchtext=%s&sCat=1' % ( sys.argv[0], sTitle) xbmc.executebuiltin('XBMC.Container.Update(%s)' % sTest) self.close() return
def onClick(self, controlId): if controlId == 11: from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SetYear(year) cBA.SetTrailerUrl(self.getProperty('trailer')) cBA.SearchBA(True) return elif controlId == 30: self.close() return elif controlId == 50 or controlId == 5200 : # print(self.getControl(50).ListItem.Property('id')) item = self.getControl(controlId).getSelectedItem() sid = item.getProperty('id') grab = cTMDb() sUrl = 'person/' + str(sid) try: meta = grab.getUrl(sUrl, '', "append_to_response=movie_credits,tv_credits") meta_credits = meta['movie_credits']['cast'] self.credit(meta_credits, 5215) try: sTitle = unicodedata.normalize('NFKD', meta['name']).encode('ascii', 'ignore') except: sTitle = 'Aucune information' if not meta['deathday']: today = date.today() try: birthday = datetime(*(time.strptime(meta['birthday'], '%Y-%m-%d')[0:6])) age = today.year - birthday.year - ((today.month, today.day) < (birthday.month, birthday.day)) age = '%s Ans' % age except: age = '' else: age = meta['deathday'] self.setProperty('Person_name', sTitle) self.setProperty('Person_birthday', meta['birthday']) self.setProperty('Person_place_of_birth', meta['place_of_birth']) self.setProperty('Person_deathday', str(age)) self.setProperty('Person_biography', meta['biography']) self.setFocusId(9000) except: return # self.getControl(50).setVisible(True) self.setProperty('matrix_menu', 'Person') # click sur similaire elif controlId == 9: # print(self.getControl(9000).ListItem.tmdb_id) sid = self.getProperty('tmdb_id') grab = cTMDb() sUrl_simil = 'movie/%s/similar' % str(sid) sUrl_recom = 'movie/%s/recommendations' % str(sid) try: meta = grab.getUrl(sUrl_simil) meta = meta['results'] self.credit(meta, 5205) except: pass try: meta = grab.getUrl(sUrl_recom) meta = meta['results'] self.credit(meta, 5210) except: return # click pour recherche elif controlId == 5215 or controlId == 5205 or controlId == 5210: import sys from resources.lib.util import cUtil item = self.getControl(controlId).getSelectedItem() sTitle = item.getLabel() try: sTitle = sTitle.encode('utf-8') sTitle = cUtil().CleanName(sTitle) except: return self.close() # Si lancé depuis la page Home de Kodi, il faut d'abord en sortir pour lancer la recherche if xbmc.getCondVisibility('Window.IsVisible(home)'): xbmc.executebuiltin('ActivateWindow(%d)' % (10028)) sTest = '%s?site=globalSearch&searchtext=%s&sCat=1' % (sys.argv[0], sTitle) xbmc.executebuiltin('Container.Update(%s)' % sTest) return
def onClick(self, controlId): print controlId if controlId == 5: self.getControl(400).setVisible(False) self.getControl(50).setVisible(True) self.setFocusId(20) return elif controlId == 20: self.getControl(50).setVisible(False) self.getControl(400).setVisible(True) self.setFocusId(5) return elif controlId == 7: self.getControl(50).setVisible(True) self.setFocusId(50) return elif controlId == 11: from resources.lib.ba import cShowBA cBA = cShowBA() cBA.SetSearch(sFileName) cBA.SearchBA() self.close() return elif controlId == 30: self.close() return elif controlId == 50: #print self.getControl(50).ListItem.Property('id') item = self.getControl(50).getSelectedItem() sid = item.getProperty('id') from resources.lib.tmdb import cTMDb grab = cTMDb() sUrl = 'person/' + str(sid) + '/movie_credits' try: meta = grab.getUrl(sUrl) meta = meta['cast'] self.credit(meta) except: return #self.getControl(50).setVisible(True) #click sur similaire elif controlId == 9: #print self.getControl(9000).ListItem.tmdb_id sid = window(10000).getProperty("ListItem.tmdb_id") from resources.lib.tmdb import cTMDb grab = cTMDb() sUrl = 'movie/%s/similar' % str(sid) try: meta = grab.getUrl(sUrl) meta = meta['results'] if meta: self.credit(meta) else: self.getControl(9).setLabel("Aucune Information") except: return #click sur recommendations elif controlId == 13: #print self.getControl(9000).ListItem.tmdb_id sid = window(10000).getProperty("ListItem.tmdb_id") from resources.lib.tmdb import cTMDb grab = cTMDb() sUrl = 'movie/%s/recommendations' % str(sid) try: meta = grab.getUrl(sUrl) meta = meta['results'] if meta: self.credit(meta) else: self.getControl(13).setLabel("Aucune Information") except: return elif controlId == 5200: #click sur un film acteur import sys from resources.lib.util import cUtil item = self.getControl(5200).getSelectedItem() sTitle = item.getLabel() try: sTitle = sTitle.encode("utf-8") sTitle = cUtil().CleanName(sTitle) except: return sTest = '%s?site=globalSearch&searchtext=%s&sCat=1' % (sys.argv[0], sTitle) xbmc.executebuiltin('XBMC.Container.Update(%s)' % sTest ) self.close() return