示例#1
0
    def open_season_info(self, prev_window=None, tvshow_id=None, season=None, tvshow=None, dbid=None):
        """
        open season info, deal with window stack
        needs *season AND (*tvshow_id OR *tvshow)
        """
        xbmc.executebuiltin("ActivateWindow(busydialog)")
        from dialogs import DialogSeasonInfo
        from TheMovieDB import get_tmdb_data
        if not tvshow_id:
            response = get_tmdb_data("search/tv?query=%s&language=%s&" % (url_quote(tvshow), SETTING("LanguageID")), 30)
            if response["results"]:
                tvshow_id = str(response['results'][0]['id'])
            else:
                tvshow = re.sub('\(.*?\)', '', tvshow)
                response = get_tmdb_data("search/tv?query=%s&language=%s&" % (url_quote(tvshow), SETTING("LanguageID")), 30)
                if response["results"]:
                    tvshow_id = str(response['results'][0]['id'])

        season_class = DialogSeasonInfo.get_season_window(WindowXML if SETTING("window_mode") == "true" else DialogXML)
        dialog = season_class(INFO_DIALOG_FILE, ADDON_PATH,
                              id=tvshow_id,
                              season=season,
                              dbid=dbid)
        xbmc.executebuiltin("Dialog.Close(busydialog)")
        self.open_dialog(dialog, prev_window)
    def open_season_info(self, prev_window=None, tvshow_id=None, season=None, tvshow=None, dbid=None):
        """
        open season info, deal with window stack
        needs *season AND (*tvshow_id OR *tvshow)
        """
        xbmc.executebuiltin("ActivateWindow(busydialog)")
        from dialogs import DialogSeasonInfo
        from TheMovieDB import get_tmdb_data
        if not tvshow_id:
            response = get_tmdb_data("search/tv?query=%s&language=%s&" % (url_quote(tvshow), SETTING("LanguageID")), 30)
            if response["results"]:
                tvshow_id = str(response['results'][0]['id'])
            else:
                tvshow = re.sub('\(.*?\)', '', tvshow)
                response = get_tmdb_data("search/tv?query=%s&language=%s&" % (url_quote(tvshow), SETTING("LanguageID")), 30)
                if response["results"]:
                    tvshow_id = str(response['results'][0]['id'])

        season_class = DialogSeasonInfo.get_season_window(WindowXML if SETTING("window_mode") == "true" else DialogXML)
        dialog = season_class(INFO_DIALOG_FILE, ADDON_PATH,
                              id=tvshow_id,
                              season=season,
                              dbid=dbid)
        xbmc.executebuiltin("Dialog.Close(busydialog)")
        self.open_dialog(dialog, prev_window)
示例#3
0
 def open_episode_info(self,
                       prev_window=None,
                       tvshow_id=None,
                       season=None,
                       episode=None,
                       tvshow=None,
                       dbid=None):
     """
     open season info, deal with window stack
     needs *tvshow_id AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     from TheMovieDB import get_tmdb_data
     ep_class = DialogEpisodeInfo.get_episode_window(
         WindowXML if SETTING("window_mode") == "true" else DialogXML)
     if not tvshow_id and tvshow:
         response = get_tmdb_data(
             "search/tv?query=%s&language=%s&" %
             (urllib.quote_plus(tvshow), SETTING("LanguageID")), 30)
         if response["results"]:
             tvshow_id = str(response['results'][0]['id'])
     dialog = ep_class(INFO_DIALOG_FILE,
                       ADDON_PATH,
                       show_id=tvshow_id,
                       season=season,
                       episode=episode,
                       dbid=dbid)
     self.open_dialog(dialog, prev_window)
示例#4
0
 def open_episode_info(self, prev_window=None, tvshow_id=None, season=None, episode=None, tvshow=None, dbid=None):
     """
     open season info, deal with window stack
     needs *tvshow_id AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     from TheMovieDB import get_tmdb_data
     ep_class = DialogEpisodeInfo.get_episode_window(WindowXML if SETTING("window_mode") == "true" else DialogXML)
     if not tvshow_id and tvshow:
         response = get_tmdb_data("search/tv?query=%s&language=%s&" % (urllib.quote_plus(tvshow), SETTING("LanguageID")), 30)
         tvshow_id = str(response['results'][0]['id'])
     dialog = ep_class(INFO_DIALOG_FILE, ADDON_PATH,
                       show_id=tvshow_id,
                       season=season,
                       episode=episode)
     self.open_dialog(dialog, prev_window)