Пример #1
0
    def GetAllocineTrailer(self,
                           Titre=None,
                           Annee=None,
                           TypeVideo=None,
                           PanneauActeur=None):
        if ADDON.getSetting('allocineactif') == "true":
            start_time = time.time()
            AllocineBA = None
            #logMsg("recherche Trailer allocine %s/%s/%s/%s" %(Titre,TypeVideo,Annee,PanneauActeur),0)
            #Annee=xbmc.getInfoLabel("ListItem.Year")
            if TypeVideo == "movie":
                AllocineBA = utils.Allocine_BandeAnnonce(
                    Titre.lower(), TypeVideo, None, None, Annee)
                #

            else:
                if not PanneauActeur:
                    Titre = xbmc.getInfoLabel("ListItem.TVShowTitle")
                Episode = None
                if TypeVideo == "tvshow":
                    Saison = None
                else:
                    Saison = str(xbmc.getInfoLabel("ListItem.Season"))

                if TypeVideo == "episode":
                    Episode = str(xbmc.getInfoLabel("ListItem.Episode"))
                    Annee = None

                AllocineBA = utils.Allocine_BandeAnnonce(
                    Titre.lower(), TypeVideo, Saison, Episode, Annee)
                #logMsg("recherche Trailer allocine %s/%s/%s/%s/%s" %(Titre,TypeVideo,Annee,Saison,Episode),0)

                #interval = time.time() - start_time
                #logMsg("Total time in seconds (%s): %s" %(xbmc.getInfoLabel("ListItem.Season"),str(interval)),0)
            if AllocineBA:
                if not self.ListeTrailer:
                    self.ListeTrailer = []
                cpt = len(AllocineBA) - 1
                while cpt >= 0:
                    self.ListeTrailer.insert(0, AllocineBA[cpt])
                    cpt = cpt - 1