Example #1
0
def startup():
    people_results=tmdb.get_people(source,page)
    person_ids=people_results['results']
    total_pages=people_results['total_pages']
    if total_pages > page:
        person_ids.append(tmdb.get_people(source,page+1)['results'][0])
        show_people(person_ids,source,page)
Example #2
0
    def onClick(self,control):
        global exit_requested
        global source
        global query
        global page
        global maxpage
        do_tv=False
        do_people=False
        do_movies=False

        popular = 32101
        query_btn = 32110
        previous = 32116
        next =32117
        tv_shows = 32114
        movies = 32113
        people = 32115
        person_id=self.get_person_from_control(control)
        if control == popular:
            source='popular'
            page=1
            do_people=True
        if control == query_btn:
            source='query'
            do_people=True
            page=1
        if control == next:
            if page < maxpage:
                page=page+1
                do_people=True
        if control == previous:
            if page > 1:
                page=page-1
                do_people=True
        if control == tv_shows:
            do_tv=True
        if control == movies:
            do_movies=True

        if do_people:
            if source=='query':
                if control==query_btn:
                    k=xbmc.Keyboard('','Enter person Title to Search For')
                    k.doModal()
                    query=k.getText()
                if query!='':
                    people=tmdb.search_people(query,page)
                    maxpage=people['total_pages']
                    people=people['results']
                    if maxpage > page:
                        people.append(tmdb.search_people(query,page+1)['results'][0])    
                    self.close()
                    show_people(people,source,page)
            else:
                query=''
                xbmc.log(source)
                people=tmdb.get_people(source,page)
                total_pages=people['total_pages']
                maxpage=10
                if source=='upcoming' or source=='now_playing':maxpage=people['total_pages']
                people=people['results']
                if total_pages > page:
                    people.append(tmdb.get_people(source,page+1)['results'][0])
                self.close()
                show_people(people,source,page)
        if do_tv:
            from resources.lib import tvshows
            tvshows.source='popular'
            tvshows.startup()
        if do_movies:
            from resources.lib import movies
            movies.source='popular'
            movies.startup()

        if person_id!='':
            from resources.lib import person
            person.person_id=person_id
            person_window = person.personWindow('script-personDetailWindow.xml', addon_path,'default')
            person_window.doModal()
            del person_window