Add files via upload
This commit is contained in:
+22
-12
@@ -45,7 +45,6 @@ def show_channels(item):
|
|||||||
"action": "remove_channel",
|
"action": "remove_channel",
|
||||||
"channel": "community"}]
|
"channel": "community"}]
|
||||||
|
|
||||||
|
|
||||||
path = os.path.join(config.get_data_path(), 'community_channels.json')
|
path = os.path.join(config.get_data_path(), 'community_channels.json')
|
||||||
file = open(path, "r")
|
file = open(path, "r")
|
||||||
json = jsontools.load(file.read())
|
json = jsontools.load(file.read())
|
||||||
@@ -53,19 +52,22 @@ def show_channels(item):
|
|||||||
itemlist.append(Item(channel=item.channel, title=config.get_localized_string(70676), action='add_channel', thumbnail=get_thumb('add.png')))
|
itemlist.append(Item(channel=item.channel, title=config.get_localized_string(70676), action='add_channel', thumbnail=get_thumb('add.png')))
|
||||||
|
|
||||||
for key, channel in json['channels'].items():
|
for key, channel in json['channels'].items():
|
||||||
if 'thumbnail' in channel:
|
|
||||||
thumbnail = channel['thumbnail']
|
|
||||||
else:
|
|
||||||
thumbnail = ''
|
|
||||||
|
|
||||||
if 'fanart' in channel:
|
file_path = channel ['path']
|
||||||
fanart = channel['fanart']
|
file_url = httptools.downloadpage(file_path, follow_redirects=True).data
|
||||||
else:
|
json_url = jsontools.load(file_url)
|
||||||
fanart = ''
|
thumbnail = json_url['thumbnail'] if 'thumbnail' in json_url else ''
|
||||||
|
fanart = json_url['fanart'] if 'fanart' in json_url else ''
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, title=channel['channel_name'], url=channel['path'],
|
itemlist.append(Item(channel=item.channel,
|
||||||
thumbnail=thumbnail, fanart=fanart, action='show_menu', channel_id = key, context=context))
|
title=channel['channel_name'],
|
||||||
return itemlist
|
url=file_path,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
fanart=fanart,
|
||||||
|
action='show_menu',
|
||||||
|
channel_id = key,
|
||||||
|
context=context))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
def load_json(item):
|
def load_json(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
@@ -127,6 +129,8 @@ def list_all(item):
|
|||||||
new_item = Item(channel=item.channel, title=title, quality=quality,
|
new_item = Item(channel=item.channel, title=title, quality=quality,
|
||||||
language=language, plot=plot, thumbnail=poster)
|
language=language, plot=plot, thumbnail=poster)
|
||||||
|
|
||||||
|
new_item.infoLabels['year'] = media['year'] if 'year' in media else ''
|
||||||
|
new_item.infoLabels['tmdb_id'] = media['tmdb_id'] if 'tmdb_id' in media else ''
|
||||||
|
|
||||||
if 'movies_list' in json_data:
|
if 'movies_list' in json_data:
|
||||||
new_item.url = media
|
new_item.url = media
|
||||||
@@ -134,10 +138,16 @@ def list_all(item):
|
|||||||
new_item.action = 'findvideos'
|
new_item.action = 'findvideos'
|
||||||
if 'year' in media:
|
if 'year' in media:
|
||||||
new_item.infoLabels['year'] = media['year']
|
new_item.infoLabels['year'] = media['year']
|
||||||
|
if 'tmdb_id' in media:
|
||||||
|
new_item.infoLabels['tmdb_id'] = media['tmdb_id']
|
||||||
else:
|
else:
|
||||||
new_item.url = media['seasons_list']
|
new_item.url = media['seasons_list']
|
||||||
new_item.contentSerieName = media['title']
|
new_item.contentSerieName = media['title']
|
||||||
new_item.action = 'seasons'
|
new_item.action = 'seasons'
|
||||||
|
if 'year' in media:
|
||||||
|
new_item.infoLabels['year'] = media['year']
|
||||||
|
if 'tmdb_id' in media:
|
||||||
|
new_item.infoLabels['tmdb_id'] = media['tmdb_id']
|
||||||
|
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user