Fix Community Channels
This commit is contained in:
+10
-5
@@ -82,7 +82,7 @@ def show_channels(item):
|
|||||||
def show_menu(item):
|
def show_menu(item):
|
||||||
support.log()
|
support.log()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# support.dbg()
|
|
||||||
|
|
||||||
if item.menu: # if second level menu
|
if item.menu: # if second level menu
|
||||||
get_sub_menu(item, item.menu, 'level2', itemlist)
|
get_sub_menu(item, item.menu, 'level2', itemlist)
|
||||||
@@ -93,7 +93,7 @@ def show_menu(item):
|
|||||||
json = load_json(item)
|
json = load_json(item)
|
||||||
if 'disable_pagination' in json:
|
if 'disable_pagination' in json:
|
||||||
item.disable_pagination = True
|
item.disable_pagination = True
|
||||||
# support.dbg()
|
|
||||||
for key in json:
|
for key in json:
|
||||||
if key == 'menu':
|
if key == 'menu':
|
||||||
get_menu(item, json, key, itemlist)
|
get_menu(item, json, key, itemlist)
|
||||||
@@ -502,7 +502,7 @@ def submenu(item, json, key, itemlist = [], filter_list = []):
|
|||||||
else:
|
else:
|
||||||
if ':/' in item.description: url = item.description
|
if ':/' in item.description: url = item.description
|
||||||
else: url = filetools.join(item.path, item.description)
|
else: url = filetools.join(item.path, item.description)
|
||||||
description = load_json(url)
|
description = load_json(url, no_order=True)
|
||||||
else:
|
else:
|
||||||
description = None
|
description = None
|
||||||
|
|
||||||
@@ -570,6 +570,7 @@ def filter_thread(filter, key, item, description):
|
|||||||
fanart = extra.fanart if extra.fanart else item.fanart
|
fanart = extra.fanart if extra.fanart else item.fanart
|
||||||
plot = extra.plot if extra.plot else item.plot
|
plot = extra.plot if extra.plot else item.plot
|
||||||
|
|
||||||
|
|
||||||
item = Item(channel=item.channel,
|
item = Item(channel=item.channel,
|
||||||
title=support.typo(filter, 'bold'),
|
title=support.typo(filter, 'bold'),
|
||||||
url=item.url,
|
url=item.url,
|
||||||
@@ -582,13 +583,17 @@ def filter_thread(filter, key, item, description):
|
|||||||
filterkey=item.filterkey,
|
filterkey=item.filterkey,
|
||||||
filter=filter,
|
filter=filter,
|
||||||
key=key)
|
key=key)
|
||||||
|
|
||||||
|
if item.filterkey in ['genre']:
|
||||||
|
support.thumb(item)
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
################################ Utils ################################
|
################################ Utils ################################
|
||||||
|
|
||||||
# for load json from item or url
|
# for load json from item or url
|
||||||
def load_json(item):
|
def load_json(item, no_order=False):
|
||||||
support.log()
|
support.log()
|
||||||
|
|
||||||
url = item.url if type(item) == Item else item
|
url = item.url if type(item) == Item else item
|
||||||
@@ -597,7 +602,7 @@ def load_json(item):
|
|||||||
json_file = httptools.downloadpage(url).data
|
json_file = httptools.downloadpage(url).data
|
||||||
else:
|
else:
|
||||||
json_file = open(url, "r").read()
|
json_file = open(url, "r").read()
|
||||||
if item.filterkey:
|
if no_order or item.filterkey:
|
||||||
json = jsontools.load(json_file)
|
json = jsontools.load(json_file)
|
||||||
else:
|
else:
|
||||||
json = jsontools.load(json_file, object_pairs_hook=OrderedDict)
|
json = jsontools.load(json_file, object_pairs_hook=OrderedDict)
|
||||||
|
|||||||
Reference in New Issue
Block a user