исправлены недочёты

master v1.2.1
Роман Бородин 2022-03-14 21:38:43 +03:00
parent 5d2aff9bc5
commit ce96563230
6 changed files with 13 additions and 8 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<addon id="script.module.iptvlib" <addon id="script.module.iptvlib"
name="IPTV Library" name="IPTV Library"
version="1.2.0" version="1.2.1"
provider-name="Dmitry Vinogradov"> provider-name="Dmitry Vinogradov">
<requires> <requires>
<import addon="xbmc.python" version="3.0.0"/> <import addon="xbmc.python" version="3.0.0"/>

View File

@ -42,7 +42,7 @@ utc_local_offset = math.ceil(calendar.timegm(time.localtime()) - time.time())
importlib.reload(sys) importlib.reload(sys)
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
sys.setdefaultencoding('utf-8') # sys.setdefaultencoding('utf-8')
TENSECS = 10 # type: int TENSECS = 10 # type: int
MIN = 60 # type: int MIN = 60 # type: int
@ -166,7 +166,7 @@ def percent_to_secs(length, percent):
def format_secs(secs, id="time"): def format_secs(secs, id="time"):
# type: (int, str) -> str # type: (int, str) -> str
if id == "time": if id == "time":
return "{:0>8}".format(datetime.timedelta(seconds=secs)) return "{:0>8}".format(str(datetime.timedelta(seconds=secs)))
if id == "skip": if id == "skip":
prefix = "+" prefix = "+"
if secs < 0: if secs < 0:

View File

@ -314,7 +314,7 @@ class Api(metaclass=abc.ABCMeta):
try: try:
log("request: %s" % request, xbmc.LOGDEBUG) log("request: %s" % request, xbmc.LOGDEBUG)
response = urllib.request.urlopen(request) # type: addinfourl response = urllib.request.urlopen(request) # type: addinfourl
content_type = response.headers.getheader("content-type") # type: str content_type = response.headers.get("content-type") # type: str
content = response.read() content = response.read()
if not content_type.startswith("application/json"): if not content_type.startswith("application/json"):
return content return content

View File

@ -2,9 +2,9 @@ import os
import shutil import shutil
from datetime import datetime from datetime import datetime
from ..skinutils import DocumentCache, get_current_skin_path, get_local_skin_path, is_invalid_local_skin, \ from skinutils import DocumentCache, get_current_skin_path, get_local_skin_path, is_invalid_local_skin, \
copy_skin_to_userdata, do_write_test, reload_skin, get_skin_name copy_skin_to_userdata, do_write_test, reload_skin, get_skin_name
from ..skinutils.fonts import FontManager as SkinUtilsFontManager from skinutils.fonts import FontManager as SkinUtilsFontManager
class FontManagerException(Exception): class FontManagerException(Exception):
@ -17,7 +17,7 @@ class FontManagerException(Exception):
super().__init__(*args) super().__init__(*args)
class FontManager(object, SkinUtilsFontManager): class FontManager(SkinUtilsFontManager):
FONTS = { FONTS = {
"script.module.iptvlib-font_MainMenu": "script.module.iptvlib-NotoSans-Bold.ttf", "script.module.iptvlib-font_MainMenu": "script.module.iptvlib-NotoSans-Bold.ttf",
"script.module.iptvlib-font30_title": "script.module.iptvlib-NotoSans-Bold.ttf", "script.module.iptvlib-font30_title": "script.module.iptvlib-NotoSans-Bold.ttf",

View File

@ -53,6 +53,11 @@ class Model(object):
# value = value.decode('utf-8') # value = value.decode('utf-8')
# except UnicodeError: # except UnicodeError:
# value = value.encode('utf-8') # value = value.encode('utf-8')
if not isinstance(value, str):
try:
value = str(value)
except:
value = value.decode('utf-8')
self._listitem.setProperty(key, value) self._listitem.setProperty(key, value)
return self._listitem return self._listitem

View File

@ -397,7 +397,7 @@ class TvDialog(xbmcgui.WindowXMLDialog, WindowMixin):
if action_id in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]: if action_id in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
confirm = xbmcgui.Dialog() confirm = xbmcgui.Dialog()
yesno = bool(confirm.yesno(addon.getAddonInfo("name"), " ", get_string(TEXT_SURE_TO_EXIT_ID))) yesno = bool(confirm.yesno(addon.getAddonInfo("name"), get_string(TEXT_SURE_TO_EXIT_ID)))
del confirm del confirm
if yesno is True: if yesno is True:
self.main_window.close() self.main_window.close()