本文整理匯總了Python中resources.lib.kodion.items.DirectoryItem.set_fanart方法的典型用法代碼示例。如果您正苦於以下問題:Python DirectoryItem.set_fanart方法的具體用法?Python DirectoryItem.set_fanart怎麽用?Python DirectoryItem.set_fanart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類resources.lib.kodion.items.DirectoryItem
的用法示例。
在下文中一共展示了DirectoryItem.set_fanart方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _do_formats
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _do_formats(self, context, json_formats):
result = []
formats = json_formats.get("items", [])
# show only free videos if not logged in or or the setting is enabled
show_only_free_videos = not self.is_logged_in() and context.get_settings().get_bool(
"nowtv.videos.only_free", False
)
for format_data in formats:
if show_only_free_videos and not format_data["free"]:
continue
format_title = format_data["title"]
params = {}
if format_data.get("seoUrl", ""):
params["seoUrl"] = format_data["seoUrl"]
pass
format_item = DirectoryItem(
format_title,
# /rtl/format/2/
context.create_uri([format_data["station"], "format", str(format_data["id"])], params),
)
format_item.set_image(format_data["images"]["thumb"])
format_item.set_fanart(format_data["images"]["fanart"])
result.append(format_item)
if self.is_logged_in():
if context.get_path() == "/nowtv/favorites/list/":
context_menu = [
(
context.localize(self._local_map["nowtv.remove_from_favs"]),
"RunPlugin(%s)"
% context.create_uri(["nowtv", "favorites", "delete"], {"format_id": format_data["id"]}),
)
]
pass
else:
context_menu = [
(
context.localize(self._local_map["nowtv.add_to_favs"]),
"RunPlugin(%s)"
% context.create_uri(["nowtv", "favorites", "add"], {"format_id": format_data["id"]}),
)
]
pass
else:
context_menu = [
(
context.localize(self._local_map["nowtv.add_to_favs"]),
"RunPlugin(%s)"
% context.create_uri(
[kodion.constants.paths.FAVORITES, "add"], {"item": kodion.items.to_jsons(format_item)}
),
)
]
pass
format_item.set_context_menu(context_menu)
pass
return result
示例2: on_search
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_search(self, search_text, context, re_match):
result = []
params = context.get_params()
page = int(params.get('page', 1))
category = params.get('category', 'sounds')
path = context.get_path()
if page == 1 and category == 'sounds':
people_params = {}
people_params.update(params)
people_params['category'] = 'people'
people_item = DirectoryItem('[B]' + context.localize(self._local_map['soundcloud.people']) + '[/B]',
context.create_uri(path, people_params),
image=context.create_resource_path('media', 'users.png'))
people_item.set_fanart(self.get_fanart(context))
result.append(people_item)
playlist_params = {}
playlist_params.update(params)
playlist_params['category'] = 'sets'
playlist_item = DirectoryItem('[B]' + context.localize(self._local_map['soundcloud.playlists']) + '[/B]',
context.create_uri(path, playlist_params),
image=context.create_resource_path('media', 'playlists.png'))
playlist_item.set_fanart(self.get_fanart(context))
result.append(playlist_item)
pass
json_data = context.get_function_cache().get(FunctionCache.ONE_MINUTE, self.get_client(context).search,
search_text,
category=category, page=page)
result.extend(self._do_collection(context, json_data, path, params))
return result
示例3: on_root
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_root(self, context, re_match):
result = []
# favorites
if len(context.get_favorite_list().list()) > 0:
fav_item = kodion.items.FavoritesItem(context, fanart=self.get_fanart(context))
fav_item.set_name('[B]%s[/B]' % fav_item.get_name())
result.append(fav_item)
pass
# watch later
if len(context.get_watch_later_list().list()) > 0:
watch_later_item = kodion.items.WatchLaterItem(context, fanart=self.get_fanart(context))
result.append(watch_later_item)
pass
# list channels
for channel_id in self._channel_ids:
channel_config = Client.CHANNELS[channel_id]
channel_id = channel_config['id']
channel_title = channel_config['title']
channel_item = DirectoryItem(channel_title, context.create_uri([channel_id, 'formats']))
channel_item.set_fanart(context.create_resource_path('media', channel_id, 'background.jpg'))
channel_item.set_image(context.create_resource_path('media', channel_id, 'logo.png'))
result.append(channel_item)
pass
# search
search_item = kodion.items.SearchItem(context, image=context.create_resource_path('media', 'search.png'),
fanart=self.get_fanart(context))
result.append(search_item)
return result
示例4: _on_explore_genre
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _on_explore_genre(self, context, re_match):
result = []
genre = re_match.group('genre')
if not genre:
json_data = context.get_function_cache().get(FunctionCache.ONE_DAY, self.get_client(context).get_categories)
category = re_match.group('category')
genres = json_data.get(category, [])
for genre in genres:
title = genre['title']
genre_item = DirectoryItem(title,
context.create_uri(['explore', 'genre', category, title]))
genre_item.set_fanart(self.get_fanart(context))
result.append(genre_item)
pass
else:
context.set_content_type(kodion.constants.content_type.SONGS)
params = context.get_params()
page = int(params.get('page', 1))
json_data = context.get_function_cache().get(FunctionCache.ONE_HOUR, self.get_client(context).get_genre,
genre=genre,
page=page)
path = context.get_path()
result = self._do_mobile_collection(context, json_data, path, params)
pass
return result
示例5: _get_channel_formats
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _get_channel_formats(self, context, re_match):
self._set_sort_method_for_content_type(context, kodion.constants.content_type.TV_SHOWS)
result = []
# load the formats of the given channel
channel_id = re_match.group('channelid')
json_data = context.get_function_cache().get(FunctionCache.ONE_DAY, self._get_client(context).get_formats,
self._get_client(context).
API_V2, channel_id)
screen = json_data.get('screen', {})
screen_objects = screen.get('screen_objects', {})
for screen_object in screen_objects:
format_id = screen_object['id'].split(':')
channel_id = format_id[0]
format_id = format_id[1]
format_item = DirectoryItem(screen_object['title'],
context.create_uri([channel_id, 'library', format_id]),
image=screen_object['image_url'])
fanart = self.get_fanart(context)
data = self._load_format_content(context, channel_id, format_id, return_cached_only=True)
if data is not None:
fanart = data.get('fanart', self.get_fanart(context))
pass
format_item.set_fanart(fanart)
context_menu = [(context.localize(kodion.constants.localize.FAVORITES_ADD),
'RunPlugin(%s)' % context.create_uri([kodion.constants.paths.FAVORITES, 'add'],
{'item': kodion.items.to_jsons(format_item)}))]
format_item.set_context_menu(context_menu)
result.append(format_item)
pass
return self._sort_result_by_name(result)
示例6: on_root
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_root(self, context, re_match):
result = []
client = self.get_client(context)
if self.is_logged_in():
# online favorites
fav_item = DirectoryItem('[B]%s[/B]' % context.localize(kodion.constants.localize.FAVORITES),
context.create_uri(['nowtv', 'favorites', 'list']),
image=context.create_resource_path('media/favorites.png'),
fanart=self.get_fanart(context))
result.append(fav_item)
# online watch later
wl_item = DirectoryItem('[B]%s[/B]' % context.localize(kodion.constants.localize.WATCH_LATER),
context.create_uri(['nowtv', 'watch_later', 'list']),
image=context.create_resource_path('media/watch_later.png'),
fanart=self.get_fanart(context))
result.append(wl_item)
pass
else:
# offline favorites
if len(context.get_favorite_list().list()) > 0:
fav_item = kodion.items.FavoritesItem(context, fanart=self.get_fanart(context))
fav_item.set_name('[B]%s[/B]' % fav_item.get_name())
result.append(fav_item)
pass
# offline watch later
if len(context.get_watch_later_list().list()) > 0:
wl_item = kodion.items.WatchLaterItem(context, fanart=self.get_fanart(context))
wl_item.set_name('[B]%s[/B]' % wl_item.get_name())
result.append(wl_item)
pass
pass
# watch later
if len(context.get_watch_later_list().list()) > 0:
watch_later_item = kodion.items.WatchLaterItem(context, fanart=self.get_fanart(context))
result.append(watch_later_item)
pass
# list channels
for channel_id in self._channel_ids:
channel_config = Client.CHANNELS[channel_id]
channel_id = channel_config['id']
channel_title = channel_config['title']
channel_item = DirectoryItem(channel_title, context.create_uri([channel_id, 'formats']))
channel_item.set_fanart(context.create_resource_path('media', channel_id, 'background.jpg'))
channel_item.set_image(context.create_resource_path('media', channel_id, 'logo.png'))
result.append(channel_item)
pass
# search
search_item = kodion.items.SearchItem(context, image=context.create_resource_path('media', 'search.png'),
fanart=self.get_fanart(context))
result.append(search_item)
return result
示例7: _screen_object_to_item
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _screen_object_to_item(self, context, screen_object, show_format_title=False):
screen_object_type = screen_object.get('type', '')
if screen_object_type == '':
raise kodion.KodimonException('Missing type for screenObject')
fanart = self.get_fanart(context)
format_id = screen_object.get('format_id', screen_object.get('id', '')).split(':')
if len(format_id) == 2:
channel_id = format_id[0]
format_id = format_id[1]
if channel_id == 'tvog':
channel_id = 'pro7'
pass
data = self._load_format_content(context, channel_id, format_id, return_cached_only=True)
fanart = data.get('fanart', self.get_fanart(context))
pass
if screen_object_type == 'video_item_date_no_label' or screen_object_type == 'video_item_date' \
or screen_object_type == 'video_item_format_no_label' or screen_object_type == 'video_item_format':
name = screen_object.get('title', screen_object['video_title'])
if screen_object_type == 'video_item_format_no_label' or show_format_title:
name = '%s - %s' % (screen_object['format_title'], name)
pass
video_item = VideoItem(name,
context.create_uri(['play'], {'id': screen_object['id']}),
image=screen_object.get('image_url', ''))
video_item.set_fanart(fanart)
video_item.set_duration_from_seconds(int(screen_object.get('duration', '60')))
date_time = datetime_parser.parse(screen_object.get('start', '0000-00-00'))
video_item.set_aired_from_datetime(date_time)
video_item.set_premiered_from_datetime(date_time)
video_item.set_year_from_datetime(date_time)
try_set_season_and_episode(video_item)
context_menu = [(context.localize(kodion.constants.localize.WATCH_LATER),
'RunPlugin(%s)' % context.create_uri([kodion.constants.paths.WATCH_LATER, 'add'],
{'item': kodion.items.to_jsons(video_item)}))]
video_item.set_context_menu(context_menu)
return video_item
elif screen_object_type == 'format_item_home' or screen_object_type == 'format_item':
format_item = DirectoryItem(screen_object['title'],
context.create_uri([channel_id, 'library', format_id]),
image=screen_object['image_url'])
format_item.set_fanart(fanart)
context_menu = [(context.localize(kodion.constants.localize.FAVORITES_ADD),
'RunPlugin(%s)' % context.create_uri([kodion.constants.paths.FAVORITES, 'add'],
{'item': kodion.items.to_jsons(format_item)}))]
format_item.set_context_menu(context_menu)
return format_item
raise kodion.KodimonException("Unknown type '%s' for screen_object" % screen_object_type)
示例8: on_channel_format
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_channel_format(self, context, re_match):
channel_id = re_match.group("channel_id")
format_id = re_match.group("format_id")
channel_config = Client.CHANNELS[channel_id]
client = self.get_client(context)
# try to process tabs
seo_url = context.get_param("seoUrl", "")
if not seo_url:
raise KodionException("seoUrl missing")
format_tabs = client.get_format_tabs(channel_config, seo_url)
# only on season tab -> show the content directly
if len(format_tabs) == 1 and format_tabs[0]["type"] == "tab":
format_tab = format_tabs[0]
return self._on_channel_format_list(context, channel_config, format_tab["id"])
# show the tabs/sections
tabs = []
for format_tab in format_tabs:
if format_tab["type"] == "tab":
tab_item = DirectoryItem(
format_tab["title"],
# /[CHANNEL_ID]/format/[FORMAT_ID]/list/[FORMAT_LIST_ID]/
context.create_uri([channel_id, "format", format_id, "list", str(format_tab["id"])]),
)
tab_item.set_image(format_tab["images"]["thumb"])
tab_item.set_fanart(format_tab["images"]["fanart"])
tabs.append(tab_item)
pass
elif format_tab["type"] == "date-span":
tab_title = format_tab["title"]
image = format_tab["images"]["thumb"]
fanart = format_tab["images"]["fanart"]
tab_item = DirectoryItem(
tab_title,
# /[CHANNEL_ID]/format/[FORMAT_ID]/year/[YEAR]/
context.create_uri(
[channel_id, "format", format_id, "year", tab_title],
{"start": format_tab["start"], "end": format_tab["end"], "image": image, "fanart": fanart},
),
)
tab_item.set_image(image)
tab_item.set_fanart(fanart)
tabs.append(tab_item)
pass
else:
raise KodionException('Unknown type "%s" for tab' % format_tab["type"])
pass
return tabs
示例9: _on_explore
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _on_explore(self, context, re_match):
result = []
# trending music
music_trending_item = DirectoryItem(context.localize(self._local_map['soundcloud.music.trending']),
context.create_uri(['explore', 'trending', 'music']),
image=context.create_resource_path('media', 'music.png'))
music_trending_item.set_fanart(self.get_fanart(context))
result.append(music_trending_item)
# trending audio
audio_trending_item = DirectoryItem(context.localize(self._local_map['soundcloud.audio.trending']),
context.create_uri(['explore', 'trending', 'audio']),
image=context.create_resource_path('media', 'audio.png'))
audio_trending_item.set_fanart(self.get_fanart(context))
result.append(audio_trending_item)
# genre music
music_genre_item = DirectoryItem(context.localize(self._local_map['soundcloud.music.genre']),
context.create_uri(['explore', 'genre', 'music']),
image=context.create_resource_path('media', 'music.png'))
music_genre_item.set_fanart(self.get_fanart(context))
result.append(music_genre_item)
# genre audio
audio_genre_item = DirectoryItem(context.localize(self._local_map['soundcloud.audio.genre']),
context.create_uri(['explore', 'genre', 'audio']),
image=context.create_resource_path('media', 'audio.png'))
audio_genre_item.set_fanart(self.get_fanart(context))
result.append(audio_genre_item)
return result
示例10: on_root
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_root(self, context, re_match):
result = []
# favorites
if len(context.get_favorite_list().list()) > 0:
fav_item = kodion.items.FavoritesItem(context, fanart=self.get_fanart(context))
result.append(fav_item)
pass
# watch later
if len(context.get_watch_later_list().list()) > 0:
watch_later_item = kodion.items.WatchLaterItem(context, fanart=self.get_fanart(context))
result.append(watch_later_item)
pass
client = self.get_client(context)
# shows (A-Z)
if 'library' in client.get_config()['supports']:
library_item = DirectoryItem(context.localize(self._local_map['now.library']),
context.create_uri(['library']),
image=context.create_resource_path('media', 'library.png'))
library_item.set_fanart(self.get_fanart(context))
result.append(library_item)
pass
# newest
if 'new' in client.get_config()['supports']:
newest_item = DirectoryItem(context.localize(self._local_map['now.newest']),
context.create_uri(['newest']),
image=context.create_resource_path('media', 'newest.png'))
newest_item.set_fanart(self.get_fanart(context))
result.append(newest_item)
pass
# tips
if 'tips' in client.get_config()['supports']:
tips_item = DirectoryItem(context.localize(self._local_map['now.tips']),
context.create_uri(['tips']),
image=context.create_resource_path('media', 'tips.png'))
tips_item.set_fanart(self.get_fanart(context))
result.append(tips_item)
pass
# top 10
if 'top10' in client.get_config()['supports']:
top10_item = DirectoryItem(context.localize(self._local_map['now.top10']),
context.create_uri(['top10']),
image=context.create_resource_path('media', 'top10.png'))
top10_item.set_fanart(self.get_fanart(context))
result.append(top10_item)
pass
# search
if 'search' in client.get_config()['supports']:
search_item = kodion.items.SearchItem(context, fanart=self.get_fanart(context))
result.append(search_item)
pass
return result
示例11: on_channel_format
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_channel_format(self, context, re_match):
channel_id = re_match.group('channel_id')
format_id = re_match.group('format_id')
channel_config = Client.CHANNELS[channel_id]
client = self.get_client(context)
# try to process tabs
seo_url = context.get_param('seoUrl', '')
if not seo_url:
raise KodionException('seoUrl missing')
format_tabs = client.get_format_tabs(channel_config, seo_url)
# only on season tab -> show the content directly
if len(format_tabs) == 1 and format_tabs[0]['type'] == 'tab':
format_tab = format_tabs[0]
return self._on_channel_format_list(context, channel_config, format_tab['id'])
# show the tabs/sections
tabs = []
for format_tab in format_tabs:
if format_tab['type'] == 'tab':
tab_item = DirectoryItem(format_tab['title'],
# /[CHANNEL_ID]/format/[FORMAT_ID]/list/[FORMAT_LIST_ID]/
context.create_uri(
[channel_id, 'format', format_id, 'list', str(format_tab['id'])]))
tab_item.set_image(format_tab['images']['thumb'])
tab_item.set_fanart(format_tab['images']['fanart'])
tabs.append(tab_item)
pass
elif format_tab['type'] == 'date-span':
tab_title = format_tab['title']
image = format_tab['images']['thumb']
fanart = format_tab['images']['fanart']
tab_item = DirectoryItem(tab_title,
# /[CHANNEL_ID]/format/[FORMAT_ID]/year/[YEAR]/
context.create_uri([channel_id, 'format', format_id, 'year', tab_title],
{'start': format_tab['start'],
'end': format_tab['end'],
'image': image,
'fanart': fanart}))
tab_item.set_image(image)
tab_item.set_fanart(fanart)
tabs.append(tab_item)
pass
else:
raise KodionException('Unknown type "%s" for tab' % format_tab['type'])
pass
return tabs
示例12: on_search
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_search(self, search_text, context, re_match):
context.get_ui().set_view_mode('videos')
result = []
json_data = self.get_client(context).search(search_text)
list = json_data.get('result', {}).get('content', {}).get('list', {})
for key in list:
item = list[key]
title = item['result']
format_id = item['formatid']
search_item = DirectoryItem(title,
context.create_uri(['format', format_id]))
search_item.set_fanart(self.get_fanart(context))
result.append(search_item)
pass
return result
示例13: _feed_to_item
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _feed_to_item(self, json_data, context):
result = []
data = json_data['data']['data']
for item in data:
gallery_item = DirectoryItem(item['title'],
context.create_uri(['show', str(item['id'])]))
gallery_item.set_fanart(self.get_fanart(context))
image = item.get('thumbnails', [])
if len(image) > 0:
image = image[0].get('url', '')
gallery_item.set_image(image)
pass
result.append(gallery_item)
pass
return result
示例14: on_root
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def on_root(self, context, re_match):
result = []
# favorites and latest videos
if len(context.get_favorite_list().list()) > 0:
fav_item = DirectoryItem('[B]' + context.localize(kodion.constants.localize.FAVORITES) + '[/B]',
context.create_uri([kodion.constants.paths.FAVORITES, 'list']),
image=context.create_resource_path('media', 'highlight.png'))
fav_item.set_fanart(self.get_fanart(context))
result.append(fav_item)
latest_item = DirectoryItem('[B]' + context.localize(kodion.constants.localize.LATEST_VIDEOS) + '[/B]',
context.create_uri(['favs', 'latest']),
image=context.create_resource_path('media', 'highlight.png'))
latest_item.set_fanart(self.get_fanart(context))
result.append(latest_item)
pass
# watch later
if len(context.get_watch_later_list().list()) > 0:
fav_item = DirectoryItem('[B]' + context.localize(kodion.constants.localize.WATCH_LATER) + '[/B]',
context.create_uri([kodion.constants.paths.WATCH_LATER, 'list']),
image=context.create_resource_path('media', 'highlight.png'))
fav_item.set_fanart(self.get_fanart(context))
result.append(fav_item)
# search
search_item = DirectoryItem('[B]' + context.localize(kodion.constants.localize.SEARCH) + '[/B]',
context.create_uri([kodion.constants.paths.SEARCH, 'list']),
image=context.create_resource_path('media', 'search.png'))
search_item.set_fanart(self.get_fanart(context))
result.append(search_item)
# channels
for channel in self._channel_id_list:
channel_data = self._channel_data.get(channel, {})
channel_image = context.create_resource_path('media', 'channels', '%s.png' % channel)
channel_item = DirectoryItem(channel_data.get('name', channel),
context.create_uri(channel),
image=channel_image)
channel_item.set_fanart(self.get_fanart(context))
result.append(channel_item)
pass
return result, {self.RESULT_CACHE_TO_DISC: False}
示例15: _do_formats
# 需要導入模塊: from resources.lib.kodion.items import DirectoryItem [as 別名]
# 或者: from resources.lib.kodion.items.DirectoryItem import set_fanart [as 別名]
def _do_formats(self, context, json_formats):
result = []
formats = json_formats.get('items', [])
# show only free videos if not logged in or or the setting is enabled
show_only_free_videos = not self.is_logged_in() or context.get_settings().get_bool('nowtv.videos.only_free',
False)
for format_data in formats:
if show_only_free_videos and not format_data['free']:
continue
format_title = format_data['title']
params = {}
if format_data.get('seoUrl', ''):
params['seoUrl'] = format_data['seoUrl']
pass
format_item = DirectoryItem(format_title,
# /rtl/format/2/
context.create_uri([format_data['station'], 'format', str(format_data['id'])],
params))
format_item.set_image(format_data['images']['thumb'])
format_item.set_fanart(format_data['images']['fanart'])
result.append(format_item)
if self.is_logged_in():
if context.get_path() == '/nowtv/favorites/list/':
context_menu = [(context.localize(self._local_map['nowtv.remove_from_favs']),
'RunPlugin(%s)' % context.create_uri(['nowtv', 'favorites', 'delete'],
{'format_id': format_data['id']}))]
pass
else:
context_menu = [(context.localize(self._local_map['nowtv.add_to_favs']),
'RunPlugin(%s)' % context.create_uri(['nowtv', 'favorites', 'add'],
{'format_id': format_data['id']}))]
pass
else:
context_menu = [(context.localize(self._local_map['nowtv.add_to_favs']),
'RunPlugin(%s)' % context.create_uri([kodion.constants.paths.FAVORITES, 'add'],
{'item': kodion.items.to_jsons(format_item)}))]
pass
format_item.set_context_menu(context_menu)
pass
return result