本文整理匯總了Python中resources.lib.TheMovieDB.get_rated_media_items方法的典型用法代碼示例。如果您正苦於以下問題:Python TheMovieDB.get_rated_media_items方法的具體用法?Python TheMovieDB.get_rated_media_items怎麽用?Python TheMovieDB.get_rated_media_items使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類resources.lib.TheMovieDB
的用法示例。
在下文中一共展示了TheMovieDB.get_rated_media_items方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: fetch_data
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_rated_media_items [as 別名]
def fetch_data(self, force=False): # TODO: rewrite
sort_by = self.sort + "." + self.order
temp = "tv" if self.type == "tv" else "movies"
if self.mode == "search":
self.filter_label = addon.LANG(32146) % self.search_str if self.search_str else ""
return tmdb.multi_search(search_str=self.search_str,
page=self.page,
cache_days=0 if force else 2)
elif self.mode == "list":
return tmdb.get_list_movies(list_id=self.list_id,
force=force)
elif self.mode == "favorites":
self.filter_label = addon.LANG(32144) if self.type == "tv" else addon.LANG(32134)
return tmdb.get_fav_items(media_type=temp,
sort_by=sort_by,
page=self.page)
elif self.mode == "rating":
self.filter_label = addon.LANG(32145) if self.type == "tv" else addon.LANG(32135)
return tmdb.get_rated_media_items(media_type=temp,
sort_by=sort_by,
page=self.page,
cache_days=0)
else:
self.set_filter_label()
params = {"sort_by": sort_by,
"language": addon.setting("LanguageID"),
"page": self.page,
"include_adult": include_adult}
filters = {item["type"]: item["id"] for item in self.filters}
response = tmdb.get_data(url="discover/%s" % (self.type),
params=utils.merge_dicts(params, filters),
cache_days=0 if force else 2)
if not response["results"]:
utils.notify(addon.LANG(284))
return None
if self.type == "movie":
itemlist = tmdb.handle_movies(results=response["results"],
local_first=False,
sortkey=None)
else:
itemlist = tmdb.handle_tvshows(results=response["results"],
local_first=False,
sortkey=None)
itemlist.set_totals(response["total_results"])
itemlist.set_total_pages(response["total_pages"])
return itemlist
示例2: open_rating_list
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_rated_media_items [as 別名]
def open_rating_list(self, control_id):
wm.show_busy()
listitems = tmdb.get_rated_media_items("tv/episodes")
wm.hide_busy()
wm.open_video_list(prev_window=self,
listitems=listitems)
示例3: open_rating_list
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_rated_media_items [as 別名]
def open_rating_list(self, control_id):
busy.show_busy()
listitems = tmdb.get_rated_media_items("tv/episodes")
busy.hide_busy()
wm.open_video_list(listitems=listitems)
示例4: start_info_actions
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_rated_media_items [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")
#.........這裏部分代碼省略.........