Beispiel #1
0
 def __init__( self, *args, **kwargs ):
     # get configuration: images path and sizes
     self.config = tmdbAPI.configuration()
     # set our person image path
     self.profile_path = self.config[ "base_url" ] + self.config[ "profile_sizes" ][ 2 ]
     #
     self.movieid = kwargs[ "movieid" ]
     self.allow_refresh = False
     self.getMovieInfo()
Beispiel #2
0
    def __init__( self, *args, **kwargs ):
        self.tbn_added = False
        self.multiimage_thread = None
        # get configuration: images path and sizes
        self.config = tmdbAPI.configuration()
        # set our person image path
        self.profile_path = self.config[ "base_url" ] + self.config[ "profile_sizes" ][ 2 ]
        # set our movie image path
        self.poster_path  = self.config[ "base_url" ] + self.config[ "poster_sizes" ][ 2 ]

        self.videodb = kwargs.get( "videodb" )
        # set our person name
        self.actor_name = kwargs.get( "actor_name" ) or ""

        # fix name if called from dialogvideoinfo.xml actor and role
        _as_ = " %s " % LangXBMC( 20347 )
        try: actor, role = self.actor_name.split( _as_.encode( "utf-8" ) )
        except:
            try: actor, role = self.actor_name.split( _as_ )
            except:
                _as_ = metautils.re.search( "(.*?)%s(.*?)" % _as_, self.actor_name )
                if _as_: actor, role = _as_.groups()
                else: actor, role = "", ""
        #xbmcgui.Dialog().ok( LangXBMC( 20347 ), actor, role )
        self.actor_name = actor or self.actor_name

        # if not name, show keyboard
        self.actor_search = self.actor_name or metautils.select_actor_from_xbmc( ACTORS )
        # Manque un actor_search = "manual"
        if self.actor_search == "manual":
            self.actor_search = metautils.keyboard()
        self.actor_search = self.actor_search

        # if not again name, call error
        if not self.actor_search:
            raise Exception( "No search person: Canceled..." )

        # search in database
        con, cur = actorsdb.getConnection()
        if self.actor_search.isdigit():
            self.actor = actorsdb.getActor( cur, idTMDB=self.actor_search )
        else:
            self.actor = actorsdb.getActor( cur, strActor=self.actor_search )
        con.close()
        OK = bool( self.actor )

        if not OK:
            # if not actor, select choices
            self.actor = dialogs.select( self )
            OK = bool( self.actor )

        # if not again name, call error
        if not OK:
            raise Exception( "No search person name %r" % self.actor_search )

        self.timeperimage = int( float( ADDON.getSetting( "timeperimage" ) ) )
Beispiel #3
0
 def __init__(self, *args, **kwargs):
     # get configuration: images path and sizes
     self.config = tmdbAPI.configuration()
     # set our person image path
     self.profile_path = self.config["base_url"] + self.config[
         "profile_sizes"][2]
     #
     self.movieid = kwargs["movieid"]
     self.allow_refresh = False
     self.getMovieInfo()
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        self.tbn_added = False
        self.multiimage_thread = None
        # get configuration: images path and sizes
        self.config = tmdbAPI.configuration()
        # set our person image path
        self.profile_path = self.config["base_url"] + self.config[
            "profile_sizes"][2]
        # set our movie image path
        self.poster_path = self.config["base_url"] + self.config[
            "poster_sizes"][2]

        self.videodb = kwargs.get("videodb")
        # set our person name
        self.actor_name = kwargs.get("actor_name") or ""

        # fix name if called from dialogvideoinfo.xml actor and role
        _as_ = " %s " % LangXBMC(20347)
        try:
            actor, role = self.actor_name.split(_as_.encode("utf-8"))
        except:
            try:
                actor, role = self.actor_name.split(_as_)
            except:
                _as_ = metautils.re.search("(.*?)%s(.*?)" % _as_,
                                           self.actor_name)
                if _as_: actor, role = _as_.groups()
                else: actor, role = "", ""
        #xbmcgui.Dialog().ok( LangXBMC( 20347 ), actor, role )
        self.actor_name = actor or self.actor_name

        # if not name, show keyboard
        self.actor_search = self.actor_name or metautils.select_actor_from_xbmc(
            ACTORS)
        # Manque un actor_search = "manual"
        if self.actor_search == "manual":
            self.actor_search = metautils.keyboard()
        self.actor_search = self.actor_search

        # if not again name, call error
        if not self.actor_search:
            raise Exception("No search person: Canceled...")

        # search in database
        con, cur = actorsdb.getConnection()
        if self.actor_search.isdigit():
            self.actor = actorsdb.getActor(cur, idTMDB=self.actor_search)
        else:
            self.actor = actorsdb.getActor(cur, strActor=self.actor_search)
        con.close()
        OK = bool(self.actor)

        if not OK:
            # if not actor, select choices
            self.actor = dialogs.select(self)
            OK = bool(self.actor)

        # if not again name, call error
        if not OK:
            raise Exception("No search person name %r" % self.actor_search)

        self.timeperimage = int(float(ADDON.getSetting("timeperimage")))