예제 #1
0
    def onClick(self,control):
        xbmc.log(str(control))
        if control==104:
            self.do_now_playing()

        if control==105:
            self.do_popular()

        if control==201:
            li=self.getControl(201).getSelectedItem()
            movie_id=int(li.getProperty('movie_id'))
            from resources.lib import movie
            movie.movie_id=movie_id
            movie.startup()

        if control==101:
            from resources.lib import movies
            movies.source='popular'
            movies.page=1
            movies.startup()

        if control==102:
            from resources.lib import tvshows
            tvshows.source='popular'
            tvshows.page=1
            tvshows.startup()

        if control==103:
            from resources.lib import people
            people.source='popular'
            people.page=1
            people.startup()

        if control==99:
            xbmc.log('query=' + self.getControl(100).getText())
            from resources.lib import movies
            movies.source='query'
            movies.doSearch(self.getControl(100).getText())
예제 #2
0
    def onClick(self,control):
        global exit_requested
        global source
        global query
        global page
        global maxpage
        do_tv_shows=False
        do_movies=False

        popular = 32101
        top_rated =  32102
        on_the_air = 32103
        airing_today = 32104
        query_btn = 32110
        previous = 32116
        next =32117
        movies_btn = 32113
        tv_btn=32114
        people_btn=32115

        if control == popular and source!='popular':
            source='popular'
            page=1
            do_tv_shows=True
        if control == top_rated and source!='top_rated':
            source='top_rated'
            do_tv_shows=True
            page=1
        if control == on_the_air and source!='on_the_air':
            source='on_the_air'
            do_tv_shows=True
            page=1
        if control == airing_today and source!='airing_today':
            source='airing_today'
            do_tv_shows=True
            page=1
        if control == query_btn:
            source='query'
            do_tv_shows=True
            page=1
        if control == next:
            if page < maxpage:
                page=page+1
                do_tv_shows=True
        if control == previous:
            if page > 1:
                page=page-1
                do_tv_shows=True
        if control == movies_btn:
            do_movies=True
        if control == people_btn:
            do_people=True

        xbmc.log('source ='+source)
        if do_tv_shows:
            if source=='query':
                if control==query_btn:
                    k=xbmc.Keyboard('','Enter TV Show Name to Search For')
                    k.doModal()
                    query=k.getText()
                if query!='':
                    tv_shows=tmdb.search_tv_shows(query,page)
                    maxpage=tv_shows['total_pages']
                    tv_shows=tv_shows['results']
                    if maxpage > page:
                        tv_shows.append(tmdb.search_tv_shows(query,page+1)['results'][0])
                    self.close()
                    show_tv(tv_shows,source,page)
            else:
                query=''
                tv_shows=tmdb.get_tv_shows(source,page)
                maxpage=10
                if source=='airing_today' or source=='on_the_air':maxpage=tv_shows['total_pages']
                total_pages=tv_shows['total_pages']
                tv_shows=tv_shows['results']
                if total_pages > page:
                    tv_shows.append(tmdb.get_tv_shows(source,page+1)['results'][0])
                self.close()
                show_tv(tv_shows,source,page)
        if do_movies:
            from resources.lib import movies
            movies.source='popular'
            movies.startup()
        if do_people:
            from resources.lib import people
            people.source='popular'
            people.startup()
예제 #3
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
예제 #4
0
# Random trailer player
#
# Author - kzeleny
# Version - 1.1.8
# Compatibility - Frodo/Gothum
#
import xbmc
import xbmcgui
import xbmcaddon
from resources.lib import tmdb
from resources.lib import movies
from resources.lib import people
from resources.lib import tvshows
from resources.lib import opening

addon = xbmcaddon.Addon()
addon_path = addon.getAddonInfo('path')
start_mode=addon.getSetting('start_mode')

if addon.getSetting('session_id')=='' and addon.getSetting('username')!='' and addon.getSetting('password')!='':
    addon.setSetting('session_id',tmdb.validate_new_user(addon.getSetting('username'),addon.getSetting('password')))

if start_mode=='0':
    opening.startup()
elif start_mode=='1':
    people.startup()
elif start_mode=='2':
    tvshows.startup()
else:
    movies.startup()