- Chiusura finestra server dopo standby

- Menu contestuale in finestra server
 - Piccoli fix deltabit e uqloads
 - Piccolo fix gestione viste
 - Fix gestione salva link
This commit is contained in:
Alhaziel01
2022-01-13 13:02:01 +01:00
parent a7a94eb20b
commit 29a5b2569e
7 changed files with 103 additions and 62 deletions
+2 -2
View File
@@ -355,7 +355,7 @@ class Item(object):
dump = "".encode("utf8")
return str(urllib.quote(base64.b64encode(dump)))
def fromurl(self, url):
def fromurl(self, url, silent=False):
"""
Generate an item from a text string. The string can be created by the tourl () function or have
the old format: plugin: //plugin.video.kod/? channel = ... (+ other parameters)
@@ -369,7 +369,7 @@ class Item(object):
decoded = False
try:
str_item = base64.b64decode(urllib.unquote(url))
json_item = json.load(str_item, object_hook=self.toutf8)
json_item = json.load(str_item, object_hook=self.toutf8, silent=silent)
if json_item is not None and len(json_item) > 0:
self.__dict__.update(json_item)
decoded = True
+10 -3
View File
@@ -16,15 +16,22 @@ if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
def load(*args, **kwargs):
silent = False
if 'silent' in kwargs:
silent = kwargs['silent']
kwargs.pop('silent')
if "object_hook" not in kwargs:
kwargs["object_hook"] = to_utf8
try:
value = json.loads(*args, **kwargs)
except:
logger.error("**NOT** able to load the JSON")
logger.error(traceback.format_exc())
logger.error('ERROR STACK ' + str(stack()[1][3]))
if not silent:
logger.error("**NOT** able to load the JSON")
logger.error(traceback.format_exc())
if len(stack()) > 1:
logger.error('ERROR STACK {}'.format(stack()[2]) )
value = {}
return value