Example #1
0
    def onAction(self, action):
        xbmc.log(str(action.getId()))
        if action == 11:  # Info
            from resources.lib import movie

            movie.movie_id = self.current_movie["id"]
            movie.startup()
        if action == 117 or action == 101:  # Context
            cm = dialogContext("context_menu.xml", addon_path, "Default")
            cm.movie = self.current_movie
            cm.mode = self.source
            cm.xbmc_movies = self.xbmc_movies
            cm.session_id = addon.getSetting("session_id")
            cm.doModal()
            xbmc.sleep(1000)
            thread.start_new(self.updateIcons, (self.current_movie, self.current_item, 3))
        if action == 10 and action != 101:
            d = xbmcgui.Dialog()
            ans = d.yesno("tmdb Browser", "Exit themoviedb.org Browser?")
            if ans:
                xbmc.executebuiltin("Dialog.Close(all,true)")
        elif action == 92:
            self.close()
        elif action == 159:
            xbmc.executebuiltin("Dialog.Close(all,true)")
            from resources.lib import opening

            opening.startup()
Example #2
0
    def onClick(self, control):
        movie_id = self.movie["id"]
        if control == 300:
            li = self.getControl(300).getSelectedItem()
            action = li.getProperty("action")
            if action == "add_favorite":
                utils.add_favorite(movie_id, self.session_id)
            if action == "remove_favorite":
                utils.remove_favorite(movie_id, self.session_id)
            if action == "add_watchlist":
                utils.remove_watchlist(movie_id, self.session_id)
            if action == "remove_watchlist":
                utils.remove_watchlist(movie_id, self.session_id)
            if action == "show_info":
                from resources.lib import movie

                movie.movie_id = self.movie["id"]
                movie.startup()
            if action == "play":
                f = utils.find_xbmc_by_title(self.movie["title"], self.movie["release_date"][:4])
                if f != "":
                    xbmc.Player().play(f)
                    xbmc.executebuiltin("Dialog.Close(all,true)")
            if action == "add_couchpotato":
                xbmc.executebuiltin(
                    "XBMC.RunPlugin('plugin://plugin.video.couchpotato_manager/movies/add?title='"
                    + self.movie["title"]
                    + "')'"
                )
            if action == "manage_list":
                ds = dialogWindow("dialog_select.xml", addon_path, "Default")
                ds.mode = "context_list"
                ds.curr_movie = self.movie
                ds.doModal()
            self.close()
Example #3
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())