Ejemplo n.º 1
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)
 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 OR *tvshow) AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     dbid = int(dbid) if dbid and int(dbid) > 0 else None
     ep_class = DialogEpisodeInfo.get_window(windows.DialogXML)
     if not tvshow_id and tvshow:
         tvshow_id = TheMovieDB.search_media(media_name=tvshow,
                                             media_type="tv",
                                             cache_days=7)
     dialog = ep_class(INFO_XML,
                       addon.PATH,
                       tvshow_id=tvshow_id,
                       season=season,
                       episode=episode,
                       dbid=dbid)
     self.open_dialog(dialog, prev_window)
Ejemplo n.º 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 OR *tvshow) AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     ep_class = DialogEpisodeInfo.get_window(self.window_type)
     if not tvshow_id and tvshow:
         params = {"query": tvshow, "language": SETTING("language")}
         response = TheMovieDB.get_data(url="search/tv",
                                        params=params,
                                        cache_days=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)
Ejemplo n.º 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)
Ejemplo n.º 5
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 OR *tvshow) AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     ep_class = DialogEpisodeInfo.get_window(self.window_type)
     if not tvshow_id and tvshow:
         tvshow_id = TheMovieDB.search_media(media_name=tvshow,
                                             media_type="tv",
                                             cache_days=7)
     dialog = ep_class(INFO_DIALOG_FILE,
                       ADDON_PATH,
                       show_id=tvshow_id,
                       season=season,
                       episode=episode,
                       dbid=dbid)
     self.open_dialog(dialog, prev_window)
Ejemplo n.º 6
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 OR *tvshow) AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     dbid = int(dbid) if dbid and int(dbid) > 0 else None
     ep_class = DialogEpisodeInfo.get_window(windows.DialogXML)
     if not tvshow_id and tvshow:
         tvshow_id = TheMovieDB.search_media(media_name=tvshow,
                                             media_type="tv",
                                             cache_days=7)
     dialog = ep_class(INFO_XML,
                       addon.PATH,
                       tvshow_id=tvshow_id,
                       season=season,
                       episode=episode,
                       dbid=dbid)
     self.open_dialog(dialog, prev_window)
Ejemplo n.º 7
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 OR *tvshow) AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     ep_class = DialogEpisodeInfo.get_window(self.window_type)
     if not tvshow_id and tvshow:
         params = {"query": tvshow,
                   "language": SETTING("language")}
         response = TheMovieDB.get_data(url="search/tv",
                                        params=params,
                                        cache_days=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)
Ejemplo n.º 8
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 OR *tvshow) AND *season AND *episode
     """
     from dialogs import DialogEpisodeInfo
     ep_class = DialogEpisodeInfo.get_window(self.window_type)
     if not tvshow_id and tvshow:
         tvshow_id = TheMovieDB.search_media(media_name=tvshow,
                                             media_type="tv",
                                             cache_days=7)
     dialog = ep_class(INFO_DIALOG_FILE,
                       ADDON_PATH,
                       show_id=tvshow_id,
                       season=season,
                       episode=episode,
                       dbid=dbid)
     self.open_dialog(dialog, prev_window)