From 61b77830fef23a4c1ae018e85c69b5c02514414a Mon Sep 17 00:00:00 2001 From: newt-sc <47229722+newt-sc@users.noreply.github.com> Date: Fri, 20 Jan 2023 20:15:28 +0200 Subject: [PATCH] release: v1.48.0 --- CHANGELOG.md | 3 +++ a4kStreaming/explorer.py | 18 ++++++++++++++---- a4kStreaming/lib/goto.py | 33 ++++++++++++++++++--------------- addon.xml | 5 ++++- packages/addons.xml | 5 ++++- packages/addons.xml.crc | 2 +- 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ca296..c05b856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* [v1.48.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.48.0): + * Support KODI 20 + * [v1.47.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.47.0): * Prevent recursion on cache miss and autoplay on diff --git a/a4kStreaming/explorer.py b/a4kStreaming/explorer.py index 1e45364..a81d01d 100644 --- a/a4kStreaming/explorer.py +++ b/a4kStreaming/explorer.py @@ -1,6 +1,13 @@ # -*- coding: utf-8 -*- -from .lib.goto import with_goto +import sys + +use_goto = sys.version_info <= (3, 8) +if use_goto: + from .lib.goto import with_goto +else: + def with_goto(func): + return func __action_menu_style = '[COLOR white][B]%s[/B][/COLOR]' @@ -2378,7 +2385,8 @@ def sorter(): autoplay = core.kodi.get_bool_setting('general.autoplay') and not params.force_sourceselect selection = 1 - label .selection # type: ignore # noqa: F821 + if use_goto: + label .selection # type: ignore # noqa: F821 if not autoplay: selection = core.kodi.xbmcgui.Dialog().select( 'Choose source', @@ -2406,7 +2414,8 @@ def sorter(): else: selection -= 1 - label .afterselection # type: ignore # noqa: F821 + if use_goto: + label .afterselection # type: ignore # noqa: F821 result = results[results_keys[selection]] video_ext = list(map(lambda v: '.%s' % v.upper(), core.utils.video_containers())) size = 1048576 * 100 @@ -2680,7 +2689,8 @@ def delete_magnet(): except: core.logger.notice(core.traceback.format_exc()) - label .play # type: ignore # noqa: F821 + if use_goto: + label .play # type: ignore # noqa: F821 item = core.kodi.xbmcgui.ListItem(path=link, offscreen=True) item.setProperty('IsPlayable', 'true') item.setContentLookup(False) diff --git a/a4kStreaming/lib/goto.py b/a4kStreaming/lib/goto.py index be9c979..d582d2e 100644 --- a/a4kStreaming/lib/goto.py +++ b/a4kStreaming/lib/goto.py @@ -45,25 +45,28 @@ def argument_bits(self): def _make_code(code, codestring): - args = [ - code.co_argcount, code.co_nlocals, code.co_stacksize, - code.co_flags, codestring, code.co_consts, - code.co_names, code.co_varnames, code.co_filename, - code.co_name, code.co_firstlineno, code.co_lnotab, - code.co_freevars, code.co_cellvars - ] - try: - args.insert(1, code.co_kwonlyargcount) # PY3 + return code.replace(co_code=codestring) # new in 3.8+ except AttributeError: - pass + args = [ + code.co_argcount, code.co_nlocals, code.co_stacksize, + code.co_flags, codestring, code.co_consts, + code.co_names, code.co_varnames, code.co_filename, + code.co_name, code.co_firstlineno, code.co_lnotab, + code.co_freevars, code.co_cellvars + ] - try: - args.insert(1, code.co_posonlyargcount) # PY3 - except AttributeError: - pass + try: + args.insert(1, code.co_kwonlyargcount) # PY3 + except AttributeError: + pass + + try: + args.insert(1, code.co_posonlyargcount) # PY3 + except AttributeError: + pass - return types.CodeType(*args) + return types.CodeType(*args) def _parse_instructions(code): diff --git a/addon.xml b/addon.xml index a372ca3..78cee8c 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ @@ -32,6 +32,9 @@ Designed for low-end devices and Estuary skin. screenshot-06.jpg +[v1.48.0]: + * Support KODI 20 + [v1.47.0]: * Prevent recursion on cache miss and autoplay on diff --git a/packages/addons.xml b/packages/addons.xml index 2559b8b..c980e08 100644 --- a/packages/addons.xml +++ b/packages/addons.xml @@ -4,7 +4,7 @@ @@ -35,6 +35,9 @@ Designed for low-end devices and Estuary skin. screenshot-06.jpg +[v1.48.0]: + * Support KODI 20 + [v1.47.0]: * Prevent recursion on cache miss and autoplay on diff --git a/packages/addons.xml.crc b/packages/addons.xml.crc index 3f8413e..5d87177 100644 --- a/packages/addons.xml.crc +++ b/packages/addons.xml.crc @@ -1 +1 @@ -15b807baf9a3417c44df76030f2b8b42b21cb89c \ No newline at end of file +aae96f5d916997c582fe6f68705fa2dae053ddd6 \ No newline at end of file