本文整理汇总了Python中meta.plugin.finish函数的典型用法代码示例。如果您正苦于以下问题:Python finish函数的具体用法?Python finish怎么用?Python finish使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了finish函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: movies_genre
def movies_genre(id, page):
""" Movies by genre id """
import_tmdb()
result = tmdb.Genres(id).movies(id=id, language=LANG, page=page)
items = list_tmdb_movies(result)
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:7,代码来源:movies.py
示例2: tmdb_movies_most_popular
def tmdb_movies_most_popular(page):
""" Most popular movies """
import_tmdb()
result = tmdb.Movies().popular(language=LANG, page=page)
items = list_tmdb_movies(result)
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:7,代码来源:movies.py
示例3: lists_trakt_liked_lists
def lists_trakt_liked_lists(page):
lists, pages = trakt.trakt_get_liked_lists(page)
items = []
for list in lists:
info = list["list"]
name = info["name"]
user = info["user"]["username"]
slug = info["ids"]["slug"]
items.append({
'label': name,
'path': plugin.url_for("lists_trakt_show_list", user = user, slug = slug),
'context_menu': [
(
_("Add list to library"),
"RunPlugin({0})".format(plugin.url_for("lists_trakt_add_all_to_library", user=user, slug=slug))
)
],
'icon': get_icon_path("traktlikedlists"),
})
if pages > page:
items.append({
'label': _("Next >>"),
'path': plugin.url_for("lists_trakt_liked_lists", page = int(page) + 1),
'icon': get_icon_path("traktlikedlists"),
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:27,代码来源:lists.py
示例4: tmdb_movies_search_term
def tmdb_movies_search_term(term, page):
""" Perform search of a specified <term>"""
import_tmdb()
result = tmdb.Search().movie(query=term, language = LANG, page = page)
items = list_tmdb_movies(result)
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:7,代码来源:movies.py
示例5: people_list_show_people
def people_list_show_people(id, source, fanart):
items = []
try:
if source == "imdb":
people = trakt.get_show_people(id)
else:
xbmcgui.Dialog().ok("Error", "No cast info found")
return plugin.finish(items=[])
except:
xbmcgui.Dialog().ok("Error", "No cast info found")
return plugin.finish(items=[])
if "cast" in people:
for actor in people["cast"]:
context_menu = [
(
"Convert to bob_xml",
"RunPlugin({0})".format(
plugin.url_for("bob_convert_person_to_xml", trakt_id=actor["person"]["ids"]["trakt"]))
)
]
image = get_person_artwork(actor)
label = "{0} ({1})".format(to_utf8(actor["person"]["name"]), to_utf8(actor["character"]))
info = actor["person"]["biography"]
items.append({'label': label,
'path': plugin.url_for("people_list_person_select", id=actor["person"]["ids"]["trakt"],
name=to_utf8(actor["person"]["name"])),
'info': info,
'thumbnail': image,
'poster': image,
'context_menu': context_menu,
'icon': "DefaultVideo.png",
'properties': {'fanart_image': fanart},
})
return plugin.finish(items=items)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:34,代码来源:people.py
示例6: list_trakt_movies_basic
def list_trakt_movies_basic(results):
from trakt import trakt
genres_dict = dict([(x['slug'], x['name']) for x in trakt.trakt_get_genres("movies")])
movies = [get_trakt_movie_metadata(item, genres_dict) for item in results]
items = [make_movie_item(movie) for movie in movies]
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:7,代码来源:movies.py
示例7: lists_trakt_my_lists
def lists_trakt_my_lists():
lists = trakt.trakt_get_lists()
items = []
for list in lists:
name = list["name"]
user = list["user"]["username"]
slug = list["ids"]["slug"]
items.append({
'label': name,
'path': plugin.url_for("lists_trakt_show_list", user = user, slug = slug),
'context_menu': [
(
_("Scan item to library"),
"RunPlugin({0})".format(plugin.url_for("lists_trakt_add_all_to_library", user=user, slug=slug))
),
(
"{0} ({1})".format(_("Play"), _("Random").lower()),
"RunPlugin({0})".format(plugin.url_for("lists_trakt_play_random", user=user, slug=slug))
)
],
'icon': get_icon_path("traktmylists"),
'thumbnail': get_icon_path("traktmylists"),
})
fanart = plugin.addon.getAddonInfo('fanart')
for item in items:
item['properties'] = {'fanart_image' : get_background_path()}
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:28,代码来源:lists.py
示例8: list_trakt_movies_related
def list_trakt_movies_related(results):
from trakt import trakt
results = sorted(results,key=lambda item: item["title"].lower().replace("the ", ""))
genres_dict = dict([(x['slug'], x['name']) for x in trakt.trakt_get_genres("movies")])
movies = [get_trakt_movie_metadata(item, genres_dict) for item in results]
items = [make_movie_item(movie) for movie in movies]
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:8,代码来源:movies.py
示例9: tmdb_movies_genres
def tmdb_movies_genres():
""" List all movie genres """
genres = get_base_genres()
items = sorted([{ 'label': name, 'icon': get_genre_icon(id), 'path': plugin.url_for("tmdb_movies_genre", id=id, page='1'), 'context_menu': [("{0} ({1})".format(_("Play"), _("Random").lower()), "RunPlugin({0})".format(plugin.url_for("tmdb_movies_play_random_genre", id = id)))]} for id, name in genres.items()], key=lambda k: k['label'])
for item in items: item['properties'] = {'fanart_image' : get_background_path()}
if FORCE == True: plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:8,代码来源:movies.py
示例10: movies_related
def movies_related(id):
import_tmdb()
movie = tmdb.Movies(id).info()
imdb_id = movie.get('imdb_id')
from trakt import trakt
results = trakt.trakt_get_related_movies_paginated(imdb_id)
items = list_trakt_movies_related(results)
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:9,代码来源:movies.py
示例11: movies_trakt_recommendations
def movies_trakt_recommendations():
from trakt import trakt
genres_dict = dict([(x['slug'], x['name']) for x in trakt.trakt_get_genres("movies")])
movies = trakt.get_recommendations("movies")
items = []
for movie in movies:
items.append(make_movie_item(get_trakt_movie_metadata(movie, genres_dict)))
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:9,代码来源:movies.py
示例12: trakt_my_movies
def trakt_my_movies():
items = [
{
'label': "{0} ({1})".format(_("Library"), "collection"),
'path': plugin.url_for("trakt_movies_collection"),
'icon': get_icon_path("traktcollection"),
'context_menu': [
(
_("Scan item to library"),
"RunPlugin({0})".format(plugin.url_for("trakt_movies_collection_to_library"))
),
(
"{0} ({1})".format(_("Play"), _("Random").lower()),
"RunPlugin({0})".format(plugin.url_for("trakt_movies_play_random_collection"))
)
]
},
{
'label': "{0} {1} ({2})".format(_("Unwatched"), _("movies"), "watchlist"),
'path': plugin.url_for("trakt_movies_watchlist"),
'icon': get_icon_path("traktwatchlist"),
'context_menu': [
(
_("Scan item to library"),
"RunPlugin({0})".format(plugin.url_for("trakt_movies_watchlist_to_library"))
),
(
"{0} ({1})".format(_("Play"), _("Random").lower()),
"RunPlugin({0})".format(plugin.url_for("trakt_movies_play_random_watchlist"))
)
]
},
{
'label':"{0} ({1})".format(_("Find similar"), "recommendations"),
'path': plugin.url_for("trakt_movies_recommendations"),
'icon': get_icon_path("traktrecommendations"),
'context_menu': [
(
_("Scan item to library"),
"RunPlugin({0})".format(plugin.url_for("trakt_movies_recommendations_to_library"))
),
(
"{0} ({1})".format(_("Play"), _("Random").lower()),
"RunPlugin({0})".format(plugin.url_for("trakt_movies_play_random_recommendation"))
)
]
}
]
for item in items: item['properties'] = {'fanart_image' : get_background_path()}
if FORCE == True: plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:51,代码来源:movies.py
示例13: list_trakt_movies_trending_paginated
def list_trakt_movies_trending_paginated(results, pages, page):
from trakt import trakt
results = sorted(results,key=lambda item: item["movie"]["title"].lower().replace("the ", ""))
genres_dict = dict([(x['slug'], x['name']) for x in trakt.trakt_get_genres("movies")])
movies = [get_trakt_movie_metadata(item["movie"], genres_dict) for item in results]
items = [make_movie_item(movie) for movie in movies]
if int(pages) > int(page):
items.append({
'label': _("Next page").format() + " >> (%s/%s)" % (int(page) + 1, int(pages)),
'path': plugin.url_for("trakt_movies_trending", page=int(page) + 1),
'icon': get_icon_path("item_next"),
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:14,代码来源:movies.py
示例14: lists_search_for_lists_term
def lists_search_for_lists_term(term, page):
lists, pages = trakt.search_for_list(term, page)
page = int(page)
pages = int(pages)
items = []
for list in lists:
if "list" in list:
list_info = list["list"]
else:
continue
name = list_info["name"]
user = list_info["username"]
slug = list_info["ids"]["slug"]
total = list_info["item_count"]
info = {}
info['title'] = name
if "description" in list_info: info["plot"] = list_info["description"]
else: info["plot"] = _("No description available")
if user != None and total != None and total != 0:
items.append({
'label': "{0} - {1} ({2})".format(to_utf8(name), to_utf8(user), total),
'path': plugin.url_for("lists_trakt_show_list", user=user, slug=slug),
'context_menu': [
(
_("Scan item to library"),
"RunPlugin({0})".format(plugin.url_for("lists_trakt_add_all_to_library", user=user, slug=slug))
),
(
"{0} ({1})".format(_("Play"), _("Random").lower()),
"RunPlugin({0})".format(plugin.url_for("lists_trakt_play_random", user=user, slug=slug))
)
],
'info': info,
'icon': get_icon_path("traktlikedlists"),
'thumbnail': get_icon_path("traktlikedlists"),
})
fanart = plugin.addon.getAddonInfo('fanart')
for item in items:
item['properties'] = {'fanart_image' : get_background_path()}
if pages > page:
items.append({
'label': _("Next page").format() + " >> (%s/%s)" % (page + 1, pages),
'path': plugin.url_for("lists_search_for_lists_term", term = term, page=page + 1),
'icon': get_icon_path("item_next"),
'thumbnail': get_icon_path("item_next"),
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:49,代码来源:lists.py
示例15: lists_search_for_lists_term
def lists_search_for_lists_term(term,page):
lists, pages = trakt.search_for_list(term, page)
page = int(page)
pages = int(pages)
items = []
for list in lists:
if "list" in list:
list_info = list["list"]
else:
continue
name = list_info["name"]
user = list_info["username"]
slug = list_info["ids"]["slug"]
info = {}
info['title'] = name
if "description" in list_info:
info["plot"] = list_info["description"]
else:
info["plot"] = _("No description available")
if user != None:
items.append({
'label': "{0} {1} {2}".format(to_utf8(name), _("by"), to_utf8(user)),
'path': plugin.url_for("lists_trakt_show_list", user=user, slug=slug),
'context_menu': [
(
_("Add list to library"),
"RunPlugin({0})".format(plugin.url_for("lists_trakt_add_all_to_library", user=user, slug=slug))
)
],
'info': info,
'icon': get_icon_path("traktlikedlists"),
})
fanart = plugin.addon.getAddonInfo('fanart')
for item in items:
item['properties'] = {'fanart_image' : get_background_path()}
if (len(items) < plugin.get_setting(SETTING_TRAKT_PER_PAGE, int) and pages > page):
page = page + 1
results = lists_search_for_lists_term(term, page)
return items + results
if pages > page:
items.append({
'label': _("Next page").format() + " >> (%s/%s)" % (page + 1, pages),
'path': plugin.url_for("lists_search_for_lists_term", term = term, page=page + 1),
'icon': get_icon_path("traktlikedlists"),
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:48,代码来源:lists.py
示例16: list_tmdb_movies
def list_tmdb_movies(result):
genres_dict = get_base_genres()
movies = [get_movie_metadata(item, genres_dict) for item in result['results']]
items = [make_movie_item(movie) for movie in movies]
if 'page' in result:
page = result['page']
args = caller_args()
if page < result['total_pages']:
args['page'] = str(page + 1)
items.append({
'label': _("Next >>"),
'icon': get_icon_path("item_next"),
'path': plugin.url_for(caller_name(), **args)
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:16,代码来源:movies.py
示例17: list_trakt_movie_items
def list_trakt_movie_items(results, pages, page):
from trakt import trakt
movies = [get_trakt_movie_metadata(item["movie"], None) for item in results]
items = [make_movie_item(movie) for movie in movies]
page = int(page)
pages = int(pages)
if pages > 1:
args = caller_args()
args['page'] = page + 1
items.append({
'label': "{0} >> ({1}/{2})".format(_("Next page"), page + 1, pages),
'path': plugin.url_for(caller_name(), **args),
'icon': get_icon_path("item_next"),
'properties' : {'fanart_image' : get_background_path()}})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:16,代码来源:movies.py
示例18: list_trakt_movies_trending_paginated
def list_trakt_movies_trending_paginated(results, pages, page):
from trakt import trakt
results = sorted(results,key=lambda item: item["movie"]["title"].lower().replace("the ", ""))
genres_dict = dict([(x['slug'], x['name']) for x in trakt.trakt_get_genres("movies")])
movies = [get_trakt_movie_metadata(item["movie"], genres_dict) for item in results]
items = [make_movie_item(movie) for movie in movies]
page = int(page)
pages = int(pages)
if pages > page:
items.append({
'label': "{0} >> ({1}/{2})".format(_("Next page"), page + 1, pages),
'path': plugin.url_for("trakt_movies_trending", page=page + 1),
'icon': get_icon_path("item_next"),
'properties' : {'fanart_image' : get_background_path()},
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:17,代码来源:movies.py
示例19: list_tmdb_items
def list_tmdb_items(result):
if FORCE == True: plugin.set_view_mode(VIEW)
genres_dict = get_base_genres()
movies = [get_movie_metadata(item, None) for item in result['results']]
items = [make_movie_item(movie) for movie in movies]
if 'page' in result:
page = int(result['page'])
pages = int(result['total_pages'])
args = caller_args()
if pages > page:
args['page'] = str(page + 1)
items.append({
'label': "{0} >> ({1}/{2})".format(_("Next page"), page + 1, pages),
'icon': get_icon_path("item_next"),
'path': plugin.url_for(caller_name(), **args),
'properties' : {'fanart_image' : get_background_path()},
})
if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
else: return plugin.finish(items=items, sort_methods=SORT)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:19,代码来源:movies.py
示例20: movies_trakt_watchlist
def movies_trakt_watchlist():
from trakt import trakt
result = trakt.trakt_get_watchlist("movies")
return plugin.finish(list_trakt_movies(result), sort_methods=MOVIE_SORT_METHODS)
开发者ID:OpenELEQ,项目名称:meta4kodi,代码行数:4,代码来源:movies.py
注:本文中的meta.plugin.finish函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论