本文整理匯總了Python中resources.lib.TheMovieDB.get_movie方法的典型用法代碼示例。如果您正苦於以下問題:Python TheMovieDB.get_movie方法的具體用法?Python TheMovieDB.get_movie怎麽用?Python TheMovieDB.get_movie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類resources.lib.TheMovieDB
的用法示例。
在下文中一共展示了TheMovieDB.get_movie方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: movie_context_menu
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_movie [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)
示例2: handle_movies
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_movie [as 別名]
def handle_movies(results):
movies = ItemList(content_type="movies")
path = 'extendedinfo&&id=%s' if addon.bool_setting("infodialog_onclick") else "playtrailer&&id=%s"
for i in results:
item = i["movie"] if "movie" in i else i
trailer = "%syoutubevideo&&id=%s" % (PLUGIN_BASE, utils.extract_youtube_id(item["trailer"]))
movie = VideoItem(label=item["title"],
path=PLUGIN_BASE + path % item["ids"]["tmdb"])
movie.set_infos({'title': item["title"],
'duration': item["runtime"] * 60 if item["runtime"] else "",
'tagline': item["tagline"],
'mediatype': "movie",
'trailer': trailer,
'year': item["year"],
'mpaa': item["certification"],
'plot': item["overview"],
'imdbnumber': item["ids"]["imdb"],
'premiered': item["released"],
'rating': round(item["rating"], 1),
'votes': item["votes"],
'genre': " / ".join(item["genres"])})
movie.set_properties({'id': item["ids"]["tmdb"],
'imdb_id': item["ids"]["imdb"],
'trakt_id': item["ids"]["trakt"],
'watchers': item.get("watchers"),
'language': item.get("language"),
'homepage': item.get("homepage")})
art_info = tmdb.get_movie(item["ids"]["tmdb"], light=True)
movie.set_artwork(tmdb.get_image_urls(poster=art_info.get("poster_path"),
fanart=art_info.get("backdrop_path")))
movies.append(movie)
movies = local_db.merge_with_local(media_type="movie",
items=movies,
library_first=False)
movies.set_sorts(["mpaa", "duration"])
return movies
示例3: update_states
# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import get_movie [as 別名]
def update_states(self):
xbmc.sleep(2000) # delay because MovieDB takes some time to update
info = tmdb.get_movie(movie_id=self.info.get_property("id"),
cache_days=0)
self.states = info.get("account_states")
super(DialogMovieInfo, self).update_states()