Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
marco
2020-10-03 14:01:24 +02:00
3 changed files with 14 additions and 5 deletions
+2 -1
View File
@@ -281,5 +281,6 @@ def play_multi_channel(item, itemlist):
def servername(server): def servername(server):
from core.servertools import translate_server_name from core.servertools import translate_server_name
path = filetools.join(config.get_runtime_path(), 'servers', server.lower() + '.json') path = filetools.join(config.get_runtime_path(), 'servers', server.lower() + '.json')
name = jsontools.load(open(path, "r").read())['name'].upper() name = jsontools.load(open(path, "r").read())['name']
if name.startswith('@'): name = config.get_localized_string(int(name.replace('@','')))
return translate_server_name(name) return translate_server_name(name)
+7 -4
View File
@@ -8,7 +8,7 @@ PY3 = False
if sys.version_info[0] >= 3:PY3 = True; unicode = str; unichr = chr; long = int if sys.version_info[0] >= 3:PY3 = True; unicode = str; unichr = chr; long = int
from core.item import Item from core.item import Item
from core import filetools from core import filetools, jsontools
from platformcode import config, logger, platformtools from platformcode import config, logger, platformtools
from platformcode.logger import WebErrorException from platformcode.logger import WebErrorException
temp_search_file = config.get_temp_file('temp-search') temp_search_file = config.get_temp_file('temp-search')
@@ -484,8 +484,8 @@ def play_from_library(item):
item.play_from = 'window' item.play_from = 'window'
itemlist = videolibrary.findvideos(item) itemlist = videolibrary.findvideos(item)
p_dialog.update(100, ''); sleep(0.5); p_dialog.close() p_dialog.update(100, ''); sleep(0.5); p_dialog.close()
while platformtools.is_playing(): # Conventional window # while platformtools.is_playing(): # Conventional window
sleep(1) # sleep(100)
play_time = platformtools.resume_playback(item, True) play_time = platformtools.resume_playback(item, True)
if not play_time and config.get_setting('autoplay'): if not play_time and config.get_setting('autoplay'):
return return
@@ -504,7 +504,10 @@ def play_from_library(item):
item.thumbnail = config.get_online_server_thumb(item.server) item.thumbnail = config.get_online_server_thumb(item.server)
quality = '[B][' + item.quality + '][/B]' if item.quality else '' quality = '[B][' + item.quality + '][/B]' if item.quality else ''
if item.server: if item.server:
it = xbmcgui.ListItem('\n[B]%s[/B] %s - %s' % (item.server, quality, item.contentTitle)) path = filetools.join(config.get_runtime_path(), 'servers', item.server.lower() + '.json')
name = jsontools.load(open(path, "r").read())['name']
if name.startswith('@'): name = config.get_localized_string(int(name.replace('@','')))
it = xbmcgui.ListItem('\n[B]%s[/B] %s - %s' % (name, quality, item.contentTitle))
it.setArt({'thumb':item.thumbnail}) it.setArt({'thumb':item.thumbnail})
options.append(it) options.append(it)
else: else:
+5
View File
@@ -90,6 +90,8 @@ 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
if 'sort' in json and json['sort']:
item.sort = True
for key in json: for key in json:
if key == 'menu': if key == 'menu':
@@ -222,6 +224,8 @@ def peliculas(item, json='', key='', itemlist=[]):
tmdb.set_infoLabels(itlist, seekTmdb=True) tmdb.set_infoLabels(itlist, seekTmdb=True)
itemlist += itlist itemlist += itlist
if item.sort:
itemlist.sort(key=lambda x: x.title, reverse=False)
if Pagination and len(itemlist) >= Pagination: if Pagination and len(itemlist) >= Pagination:
if inspect.stack()[1][3] != 'get_newest': if inspect.stack()[1][3] != 'get_newest':
item.title = support.typo(config.get_localized_string(30992), 'color kod bold') item.title = support.typo(config.get_localized_string(30992), 'color kod bold')
@@ -784,6 +788,7 @@ def add_channel(item):
file_path = xbmcgui.Dialog().browseSingle(1, config.get_localized_string(70680), 'files') file_path = xbmcgui.Dialog().browseSingle(1, config.get_localized_string(70680), 'files')
try: try:
channel_to_add['path'] = file_path channel_to_add['path'] = file_path
channel_to_add['url'] = file_path
json_file = jsontools.load(open(file_path, "r").read()) json_file = jsontools.load(open(file_path, "r").read())
channel_to_add['channel_name'] = json_file['channel_name'] channel_to_add['channel_name'] = json_file['channel_name']
except: except: