def open_tvshow_info(self, prev_window=None, tmdb_id=None, dbid=None, tvdb_id=None, imdb_id=None, name=None): """ open tvshow info, deal with window stack """ xbmc.executebuiltin("ActivateWindow(busydialog)") from dialogs import DialogTVShowInfo if tmdb_id: pass elif tvdb_id: tmdb_id = TheMovieDB.get_show_tmdb_id(tvdb_id) elif imdb_id: tmdb_id = TheMovieDB.get_show_tmdb_id(tvdb_id=imdb_id, source="imdb_id") elif dbid and (int(dbid) > 0): tvdb_id = local_db.get_imdb_id(media_type="tvshow", dbid=dbid) if tvdb_id: tmdb_id = TheMovieDB.get_show_tmdb_id(tvdb_id) elif name: tmdb_id = TheMovieDB.search_media(media_name=name, year="", media_type="tv") tvshow_class = DialogTVShowInfo.get_window(self.window_type) dialog = tvshow_class(INFO_DIALOG_FILE, ADDON_PATH, tmdb_id=tmdb_id, dbid=dbid) xbmc.executebuiltin("Dialog.Close(busydialog)") self.open_dialog(dialog, prev_window)
def open_tvshow_info(self, prev_window=None, tmdb_id=None, dbid=None, tvdb_id=None, imdb_id=None, name=None): """ open tvshow info, deal with window stack """ xbmc.executebuiltin("ActivateWindow(busydialog)") dbid = int(dbid) if dbid and int(dbid) > 0 else None from dialogs import DialogTVShowInfo if tmdb_id: pass elif tvdb_id: tmdb_id = TheMovieDB.get_show_tmdb_id(tvdb_id) elif imdb_id: tmdb_id = TheMovieDB.get_show_tmdb_id(tvdb_id=imdb_id, source="imdb_id") elif dbid: tvdb_id = local_db.get_imdb_id(media_type="tvshow", dbid=dbid) if tvdb_id: tmdb_id = TheMovieDB.get_show_tmdb_id(tvdb_id) elif name: tmdb_id = TheMovieDB.search_media(media_name=name, year="", media_type="tv") tvshow_class = DialogTVShowInfo.get_window(self.window_type) dialog = tvshow_class(INFO_DIALOG_FILE, ADDON_PATH, tmdb_id=tmdb_id, dbid=dbid) xbmc.executebuiltin("Dialog.Close(busydialog)") self.open_dialog(dialog, prev_window)
def get_movie_tmdb_id(imdb_id=None, name=None, dbid=None): if dbid and (int(dbid) > 0): movie_id = local_db.get_imdb_id("movie", dbid) log("IMDB Id from local DB: %s" % (movie_id)) return movie_id elif imdb_id: params = {"external_source": "imdb_id", "language": SETTING("LanguageID")} response = get_data(url="find/tt%s" % (imdb_id.replace("tt", "")), params=params) if response and response["movie_results"]: return response["movie_results"][0]["id"] if name: return search_media(name) else: return None