當前位置: 首頁>>代碼示例>>Python>>正文


Python TheMovieDB.get_account_lists方法代碼示例

本文整理匯總了Python中resources.lib.TheMovieDB.get_account_lists方法的典型用法代碼示例。如果您正苦於以下問題:Python TheMovieDB.get_account_lists方法的具體用法?Python TheMovieDB.get_account_lists怎麽用?Python TheMovieDB.get_account_lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在resources.lib.TheMovieDB的用法示例。


在下文中一共展示了TheMovieDB.get_account_lists方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: open_account_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_account_lists [as 別名]
 def open_account_menu(self, control_id):
     if self.type == "tv":
         listitems = [addon.LANG(32145)]
         if self.logged_in:
             listitems.append(addon.LANG(32144))
     else:
         listitems = [addon.LANG(32135)]
         if self.logged_in:
             listitems.append(addon.LANG(32134))
     wm.show_busy()
     if self.logged_in:
         account_lists = tmdb.get_account_lists()
         listitems += ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
     wm.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == -1:
         pass
     elif index == 0:
         self.sort = "created_at"
         self.sort_label = addon.LANG(32157)
         self.filters = []
         self.reset("rating")
     elif index == 1:
         self.sort = "created_at"
         self.sort_label = addon.LANG(32157)
         self.filters = []
         self.reset("favorites")
     else:
         self.close()
         dialog = wm.open_video_list(filters=[],
                                     mode="list",
                                     list_id=account_lists[index - 2]["id"],
                                     filter_label=account_lists[index - 2]["name"])
         dialog.doModal()
開發者ID:OpenELEQ,項目名稱:script.extendedinfo,代碼行數:37,代碼來源:DialogVideoList.py

示例2: movie_context_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_account_lists [as 別名]
 def movie_context_menu(self, control_id):
     movie_id = self.FocusedItem(control_id).getProperty("id")
     dbid = self.FocusedItem(control_id).getVideoInfoTag().getDbId()
     options = [addon.LANG(32113)]
     if self.logged_in:
         options.append(addon.LANG(32083))
     index = xbmcgui.Dialog().contextmenu(list=options)
     if index == 0:
         rating = utils.input_userrating()
         if rating == -1:
             return None
         tmdb.set_rating(media_type="movie",
                         media_id=movie_id,
                         rating=rating,
                         dbid=dbid)
         xbmc.sleep(2000)
         tmdb.get_movie(movie_id=movie_id,
                        cache_days=0)
     elif index == 1:
         account_lists = tmdb.get_account_lists()
         if not account_lists:
             return False
         listitems = ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
         i = xbmcgui.Dialog().select(addon.LANG(32136), listitems)
         if i > -1:
             tmdb.change_list_status(list_id=account_lists[i]["id"],
                                     movie_id=movie_id,
                                     status=True)
開發者ID:BigNoid,項目名稱:script.extendedinfo,代碼行數:30,代碼來源:DialogBaseInfo.py

示例3: add_to_list_button

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_account_lists [as 別名]
 def add_to_list_button(self, control_id):
     busy.show_busy()
     account_lists = tmdb.get_account_lists()
     listitems = ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
     listitems.insert(0, addon.LANG(32139))
     listitems.append(addon.LANG(32138))
     busy.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=addon.LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if not listname:
             return None
         list_id = tmdb.create_list(listname)
         xbmc.sleep(1000)
         tmdb.change_list_status(list_id=list_id,
                                 movie_id=self.info.get_property("id"),
                                 status=True)
     elif index == len(listitems) - 1:
         if tmdb.remove_list_dialog(tmdb.handle_lists(account_lists)):
             self.update_states()
     elif index > 0:
         tmdb.change_list_status(account_lists[index - 1]["id"], self.info.get_property("id"), True)
         self.update_states()
開發者ID:phil65,項目名稱:script.extendedinfo,代碼行數:27,代碼來源:DialogMovieInfo.py

示例4: open_list_button

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_account_lists [as 別名]
 def open_list_button(self, control_id):
     busy.show_busy()
     movie_lists = tmdb.get_account_lists()
     listitems = ["%s (%i)" % (i["name"], i["item_count"]) for i in movie_lists]
     listitems = [addon.LANG(32134), addon.LANG(32135)] + listitems
     busy.hide_busy()
     index = xbmcgui.Dialog().select(addon.LANG(32136), listitems)
     if index == -1:
         pass
     elif index < 2:
         wm.open_video_list(mode="favorites" if index == 0 else "rating")
     else:
         wm.open_video_list(mode="list",
                            list_id=movie_lists[index - 2]["id"],
                            filter_label=movie_lists[index - 2]["name"],
                            force=True)
開發者ID:phil65,項目名稱:script.extendedinfo,代碼行數:18,代碼來源:DialogMovieInfo.py

示例5: list_dialog

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_account_lists [as 別名]
 def list_dialog(self, movie_id):
     busy.show_busy()
     listitems = [addon.LANG(32139)]
     account_lists = tmdb.get_account_lists()
     listitems += ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
     listitems.append(addon.LANG(32138))
     busy.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=addon.LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if listname:
             xbmc.sleep(1000)
             tmdb.change_list_status(list_id=tmdb.create_list(listname),
                                     movie_id=movie_id,
                                     status=True)
     elif index == len(listitems) - 1:
         tmdb.remove_list_dialog(tmdb.handle_lists(account_lists))
     elif index > 0:
         tmdb.change_list_status(list_id=account_lists[index - 1]["id"],
                                 movie_id=movie_id,
                                 status=True)
開發者ID:BigNoid,項目名稱:script.extendedinfo,代碼行數:25,代碼來源:DialogVideoList.py

示例6: start_info_actions

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_account_lists [as 別名]
def start_info_actions(info, params):
    if "artistname" in params:
        params["artistname"] = params.get("artistname", "").split(" feat. ")[0].strip()
        if not params.get("artist_mbid"):
            params["artist_mbid"] = utils.fetch_musicbrainz_id(params["artistname"])
    utils.log(info)
    utils.pp(params)
    if "prefix" in params and not params["prefix"].endswith('.'):
        params["prefix"] = params["prefix"] + '.'

    # Audio
    if info == 'discography':
        discography = AudioDB.get_artist_discography(params["artistname"])
        if not discography:
            discography = LastFM.get_artist_albums(params.get("artist_mbid"))
        return discography
    elif info == 'mostlovedtracks':
        return AudioDB.get_most_loved_tracks(params["artistname"])
    elif info == 'trackdetails':
        return AudioDB.get_track_details(params.get("id", ""))
    elif info == 'topartists':
        return LastFM.get_top_artists()
    #  The MovieDB
    elif info == 'incinemamovies':
        return tmdb.get_movies("now_playing")
    elif info == 'upcomingmovies':
        return tmdb.get_movies("upcoming")
    elif info == 'topratedmovies':
        return tmdb.get_movies("top_rated")
    elif info == 'popularmovies':
        return tmdb.get_movies("popular")
    elif info == 'ratedmovies':
        return tmdb.get_rated_media_items("movies")
    elif info == 'starredmovies':
        return tmdb.get_fav_items("movies")
    elif info == 'accountlists':
        return tmdb.handle_lists(tmdb.get_account_lists())
    elif info == 'listmovies':
        return tmdb.get_movies_from_list(params["id"])
    elif info == 'airingtodaytvshows':
        return tmdb.get_tvshows("airing_today")
    elif info == 'onairtvshows':
        return tmdb.get_tvshows("on_the_air")
    elif info == 'topratedtvshows':
        return tmdb.get_tvshows("top_rated")
    elif info == 'populartvshows':
        return tmdb.get_tvshows("popular")
    elif info == 'ratedtvshows':
        return tmdb.get_rated_media_items("tv")
    elif info == 'ratedepisodes':
        return tmdb.get_rated_media_items("tv/episodes")
    elif info == 'starredtvshows':
        return tmdb.get_fav_items("tv")
    elif info == 'similarmovies':
        movie_id = params.get("id")
        if not movie_id:
            movie_id = tmdb.get_movie_tmdb_id(imdb_id=params.get("imdb_id"),
                                              dbid=params.get("dbid"))
        if movie_id:
            return tmdb.get_similar_movies(movie_id)
    elif info == 'similartvshows':
        tvshow_id = None
        dbid = params.get("dbid")
        name = params.get("name")
        tmdb_id = params.get("tmdb_id")
        tvdb_id = params.get("tvdb_id")
        imdb_id = params.get("imdb_id")
        if tmdb_id:
            tvshow_id = tmdb_id
        elif dbid and int(dbid) > 0:
            tvdb_id = local_db.get_imdb_id("tvshow", dbid)
            if tvdb_id:
                tvshow_id = tmdb.get_show_tmdb_id(tvdb_id)
        elif tvdb_id:
            tvshow_id = tmdb.get_show_tmdb_id(tvdb_id)
        elif imdb_id:
            tvshow_id = tmdb.get_show_tmdb_id(imdb_id, "imdb_id")
        elif name:
            tvshow_id = tmdb.search_media(media_name=name,
                                          year="",
                                          media_type="tv")
        if tvshow_id:
            return tmdb.get_similar_tvshows(tvshow_id)
    elif info == 'studio':
        if params.get("id"):
            return tmdb.get_company_data(params["id"])
        elif params.get("studio"):
            company_data = tmdb.search_companies(params["studio"])
            if company_data:
                return tmdb.get_company_data(company_data[0]["id"])
    elif info == 'set':
        if params.get("dbid"):
            name = local_db.get_set_name(params["dbid"])
            if name:
                params["setid"] = tmdb.get_set_id(name)
        if params.get("setid"):
            set_data, _ = tmdb.get_set_movies(params["setid"])
            return set_data
    elif info == 'movielists':
        movie_id = params.get("id")
#.........這裏部分代碼省略.........
開發者ID:phil65,項目名稱:script.extendedinfo,代碼行數:103,代碼來源:process.py


注:本文中的resources.lib.TheMovieDB.get_account_lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。