def set_company_filter(self, control_id): result = xbmcgui.Dialog().input(heading=addon.LANG(16017), type=xbmcgui.INPUT_ALPHANUM) if not result or result < 0: return None items = tmdb.search_companies(result) if len(items) > 1: index = selectdialog.open(header=addon.LANG(32151), listitems=items) if index > -1: item = items[index] elif items: item = items[0] else: utils.notify("No company found") self.add_filter(key="with_companies", value=item.get_property("id"), label=item.get_label())
def open_credit_dialog(self, credit_id): info = tmdb.get_credit_info(credit_id) listitems = [] if "seasons" in info["media"]: listitems += tmdb.handle_seasons(info["media"]["seasons"]) if "episodes" in info["media"]: listitems += tmdb.handle_episodes(info["media"]["episodes"]) if not listitems: listitems += [{"label": addon.LANG(19055)}] index = selectdialog.open(header=addon.LANG(32151), listitems=listitems) if index == -1: return None listitem = listitems[index] if listitem["mediatype"] == "episode": wm.open_episode_info(season=listitem["season"], episode=listitem["episode"], tvshow_id=info["media"]["id"]) elif listitem["mediatype"] == "season": wm.open_season_info(season=listitem["season"], tvshow_id=info["media"]["id"])