def setProperties( self ):
        self.clearProperties()
        if not self.current_actor: return
        #( "idactor", "id", "name", "biography", "biooutline", "birthday", "deathday", "placeofbirth", "alsoknownas", "homepage", "adult", "cachedthumb" )
        window = xbmcgui.Window( self.windowID )
        birthday = self.current_actor[ 5 ] or ""
        window.setProperty( "current.actor.name",         self.current_actor[ 2 ]  or "" )
        window.setProperty( "current.actor.biography",    metautils.clean_bio( self.current_actor[ 3 ] or "" ) )
        window.setProperty( "current.actor.biooutline",   self.current_actor[ 4 ]  or "" )
        window.setProperty( "current.actor.birthday",     birthday )
        window.setProperty( "current.actor.deathday",     self.current_actor[ 6 ]  or "" )
        window.setProperty( "current.actor.placeofbirth", self.current_actor[ 7 ]  or "" )
        window.setProperty( "current.actor.alsoknownas",  self.current_actor[ 8 ]  or "" )
        window.setProperty( "current.actor.homepage",     self.current_actor[ 9 ]  or "" )
        window.setProperty( "current.actor.adult",        self.current_actor[ 10 ] or "" )
        if birthday and BIRTH_MONTHDAY in birthday:
            window.setProperty( "current.actor.happybirthday", "true" )
        actuel_age, dead_age, dead_since = metautils.get_ages( birthday, self.current_actor[ 6 ] )
        window.setProperty( "current.actor.age",      actuel_age )
        window.setProperty( "current.actor.deathage", dead_age )
        if actuel_age: window.setProperty( "current.actor.agelong",      STR_AGE_LONG % actuel_age )
        if dead_since: window.setProperty( "current.actor.deathagelong", STR_DEAD_SINCE % dead_since )
        elif dead_age: window.setProperty( "current.actor.deathagelong", STR_DEATH_AGE_LONG % dead_age )

        fanart = TBN.get_fanarts( self.current_actor[ 2 ] )[ 0 ]
        window.setProperty( "current.actor.fanart", fanart )
        icon = "".join( TBN.get_thumb( self.current_actor[ 2 ] ) )
        window.setProperty( "current.actor.icon",   icon )

        # check exist to prevent multiple ERROR: XFILE::CDirectory::GetDirectory - Error getting special://thumbnails/Actors/[ACTOR NAME]/foo/
        cached_actor_thumb = "special://thumbnails/Actors/" + self.current_actor[ 2 ] + "/"
        for extra in [ "extrafanart", "extrathumb" ]:
            #if xbmcvfs.exists( cached_actor_thumb + extra ):
            window.setProperty( "current.actor." + extra, cached_actor_thumb + extra )
Example #2
0
def setActorProperties( listitem, actor ):
    birthday = actor.get( "birthday" ) or ""
    if birthday and BIRTH_MONTHDAY in str( birthday ):
        listitem.setProperty( "HappyBirthday", "true" )

    listitem.setProperty( "Biography",    actor[ "biography" ] )
    listitem.setProperty( "Biooutline",   actor[ "biooutline" ] or "" )
    listitem.setProperty( "Homepage",     actor[ "homepage" ]   or "" )
    listitem.setProperty( "PlaceOfBirth", actor[ "place_of_birth" ] or "" )
    listitem.setProperty( "AlsoKnownAs",  actor[ "also_known_as" ]  or "" )

    if showlabeladult:
        adult = LangXBMC( ( 106, 107 )[ str( actor[ "adult" ] ).lower() == "true" ] )
        if showlabeladult == 2 and adult == LangXBMC( 106 ): adult = ""
        listitem.setProperty( "Adult", adult )

    birthday = metautils.get_user_date_format( birthday, bdayformat )
    deathday = metautils.get_user_date_format( ( actor[ "deathday" ] or "" ), bdayformat )
    listitem.setProperty( "Birthday",     metautils.translate_date( birthday, dateformat ) )
    listitem.setProperty( "Deathday",     metautils.translate_date( deathday, dateformat ) )

    actuel_age, dead_age, dead_since = metautils.get_ages( actor[ "birthday" ], actor[ "deathday" ] )
    listitem.setProperty( "Age",          actuel_age )
    listitem.setProperty( "Deathage",     dead_age )
    listitem.setProperty( "AgeLong",      "" )
    listitem.setProperty( "DeathageLong", "" )
    if actuel_age: listitem.setProperty( "AgeLong",      Language( 32020 ) % actuel_age )
    if dead_since: listitem.setProperty( "DeathageLong", Language( 32021 ) % dead_since )
    elif dead_age: listitem.setProperty( "DeathageLong", Language( 32020 ) % dead_age )

    return listitem
Example #3
0
    def setProperties(self):
        self.clearProperties()
        if not self.current_actor: return
        #( "idactor", "id", "name", "biography", "biooutline", "birthday", "deathday", "placeofbirth", "alsoknownas", "homepage", "adult", "cachedthumb" )
        window = xbmcgui.Window(self.windowID)
        birthday = self.current_actor[5] or ""
        window.setProperty("current.actor.name", self.current_actor[2] or "")
        window.setProperty("current.actor.biography",
                           metautils.clean_bio(self.current_actor[3] or ""))
        window.setProperty("current.actor.biooutline", self.current_actor[4]
                           or "")
        window.setProperty("current.actor.birthday", birthday)
        window.setProperty("current.actor.deathday", self.current_actor[6]
                           or "")
        window.setProperty("current.actor.placeofbirth", self.current_actor[7]
                           or "")
        window.setProperty("current.actor.alsoknownas", self.current_actor[8]
                           or "")
        window.setProperty("current.actor.homepage", self.current_actor[9]
                           or "")
        window.setProperty("current.actor.adult", self.current_actor[10] or "")
        if birthday and BIRTH_MONTHDAY in birthday:
            window.setProperty("current.actor.happybirthday", "true")
        actuel_age, dead_age, dead_since = metautils.get_ages(
            birthday, self.current_actor[6])
        window.setProperty("current.actor.age", actuel_age)
        window.setProperty("current.actor.deathage", dead_age)
        if actuel_age:
            window.setProperty("current.actor.agelong",
                               STR_AGE_LONG % actuel_age)
        if dead_since:
            window.setProperty("current.actor.deathagelong",
                               STR_DEAD_SINCE % dead_since)
        elif dead_age:
            window.setProperty("current.actor.deathagelong",
                               STR_DEATH_AGE_LONG % dead_age)

        fanart = TBN.get_fanarts(self.current_actor[2])[0]
        window.setProperty("current.actor.fanart", fanart)
        icon = "".join(TBN.get_thumb(self.current_actor[2]))
        window.setProperty("current.actor.icon", icon)

        # check exist to prevent multiple ERROR: XFILE::CDirectory::GetDirectory - Error getting special://thumbnails/Actors/[ACTOR NAME]/foo/
        cached_actor_thumb = "special://thumbnails/Actors/" + self.current_actor[
            2] + "/"
        for extra in ["extrafanart", "extrathumb"]:
            #if xbmcvfs.exists( cached_actor_thumb + extra ):
            window.setProperty("current.actor." + extra,
                               cached_actor_thumb + extra)