From fd84a94fec965f7275d7ebc2d064e3030505edd8 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:32:33 -0500 Subject: [PATCH 1/7] convert to new settings format --- resources/settings.xml | 46 +++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/resources/settings.xml b/resources/settings.xml index 0ee654e..6865ba1 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -1,10 +1,38 @@ - - - - - - - - - + + +
+ + + + 0 + false + + + + 0 + true + + + + 0 + 59994 + + 32005 + + + + 0 + 15 + + + true + + + + 32004 + + + + +
From 3b1e652c57860bf5f79343bca6b35765a9898e7d Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:38:51 -0500 Subject: [PATCH 2/7] remove python 2 support --- resources/lib/storage_server/StorageServer.py | 65 +++++++------------ 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/resources/lib/storage_server/StorageServer.py b/resources/lib/storage_server/StorageServer.py index 39da0d1..9f68583 100644 --- a/resources/lib/storage_server/StorageServer.py +++ b/resources/lib/storage_server/StorageServer.py @@ -34,13 +34,6 @@ except ImportError: sqlite = None -try: - basestring -except NameError: - basestring = str - -PY3 = sys.version_info[0] >= 3 - class StorageServer: def __init__(self, table=None, timeout=24, instance=False): @@ -297,8 +290,7 @@ def _recv(self, sock): recv_buffer = sock.recv(self.network_buffer_size) idle = False i += 1 - if PY3: - recv_buffer = recv_buffer.decode('utf-8', 'ignore') + recv_buffer = recv_buffer.decode('utf-8', 'ignore') self._log(u"got data : " + str(i) + u" - " + repr(idle) + u" - " + str(len(data)) + u" + " + str(len(recv_buffer)) + u" | " + repr(recv_buffer)[len(recv_buffer) - 5:]) @@ -307,15 +299,13 @@ def _recv(self, sock): elif not idle: if data[len(data) - 2:] == "\r\n": content = "COMPLETE\r\n" + (" " * (15 - len("COMPLETE\r\n"))) - if PY3: - content = content.encode('utf-8', 'ignore') + content = content.encode('utf-8', 'ignore') sock.send(content) idle = True self._log(u"sent COMPLETE " + str(i)) elif len(recv_buffer) > 0: content = "ACK\r\n" + (" " * (15 - len("ACK\r\n"))) - if PY3: - content = content.encode('utf-8', 'ignore') + content = content.encode('utf-8', 'ignore') sock.send(content) idle = True self._log(u"sent ACK " + str(i)) @@ -351,8 +341,7 @@ def _send(self, sock, data): send_buffer = data[:self.network_buffer_size] else: send_buffer = data + "\r\n" - if PY3: - send_buffer = send_buffer.encode('utf-8', 'ignore') + send_buffer = send_buffer.encode('utf-8', 'ignore') result = sock.send(send_buffer) i += 1 idle = False @@ -361,8 +350,7 @@ def _send(self, sock, data): status = "" while status.find("COMPLETE\r\n") == -1 and status.find("ACK\r\n") == -1: status = sock.recv(15) - if PY3: - status = status.decode('utf-8', 'ignore') + status = status.decode('utf-8', 'ignore') i -= 1 idle = True @@ -543,35 +531,28 @@ def _generateKey(self, funct, *args): for key in sorted(params.keys()): if key not in ["new_results_function"]: val = params[key] - if not isinstance(val, basestring): + if not isinstance(val, str): val = str(val) - if PY3: - if isinstance(key, str): - key = key.encode('utf-8') - if isinstance(val, str): - val = val.encode('utf-8') - key_val_pair = b"'%s'='%s'" % (key, val) - else: - key_val_pair = "'%s'='%s'" % (key, val) + if isinstance(key, str): + key = key.encode('utf-8') + if isinstance(val, str): + val = val.encode('utf-8') + key_val_pair = b"'%s'='%s'" % (key, val) keyhash.update(key_val_pair) elif isinstance(params, list): - if PY3: - hash_list = [] - for el in params: - if not isinstance(el, basestring): - el = str(el) - if isinstance(el, str): - el = el.encode('utf-8') - hash_list.append(el) - keyhash.update(b",".join([b"%s" % el for el in hash_list])) - else: - keyhash.update(",".join(["%s" % el for el in params])) + hash_list = [] + for el in params: + if not isinstance(el, str): + el = str(el) + if isinstance(el, str): + el = el.encode('utf-8') + hash_list.append(el) + keyhash.update(b",".join([b"%s" % el for el in hash_list])) else: - if not isinstance(params, basestring): + if not isinstance(params, str): params = str(params) - if PY3: - if isinstance(params, str): - params = params.encode('utf-8') + if isinstance(params, str): + params = params.encode('utf-8') keyhash.update(params) name += "|" + keyhash.hexdigest() + "|" @@ -805,8 +786,6 @@ def _log(self, description): def to_unicode(text): if isinstance(text, bytes): return text.decode('utf-8') - if sys.version_info[0] == 2 and isinstance(text, str): - return text.decode('utf-8') return text From c90813eef5bc32b70be1e02e688270c1685bc211 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:40:47 -0500 Subject: [PATCH 3/7] remove unsupport attribute from service entrypoint --- addon.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon.xml b/addon.xml index bba81a8..c9aa826 100644 --- a/addon.xml +++ b/addon.xml @@ -3,7 +3,7 @@ - + From c6baff9c80b80cfcfdbd97614116f3c3c18a0dc3 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:41:00 -0500 Subject: [PATCH 4/7] set minimum version to nexus --- addon.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon.xml b/addon.xml index c9aa826..838ebc7 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ - + From 0cb4a3a43b5fd3b6906c5f4f09cd9ca296717a70 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:43:31 -0500 Subject: [PATCH 5/7] update workflows to nexus --- .github/workflows/addon-validations.yml | 27 ++++----------- .github/workflows/make-release.yml | 45 +++++-------------------- .github/workflows/submit-release.yml | 39 +++------------------ 3 files changed, 20 insertions(+), 91 deletions(-) diff --git a/.github/workflows/addon-validations.yml b/.github/workflows/addon-validations.yml index 3b808cf..7794293 100644 --- a/.github/workflows/addon-validations.yml +++ b/.github/workflows/addon-validations.yml @@ -16,13 +16,13 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Python v3.6 - uses: actions/setup-python@v2 + - name: Set up Python v3.9 + uses: actions/setup-python@v3 with: - python-version: '3.6' + python-version: '3.9' - name: Checkout Add-on - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} @@ -31,20 +31,7 @@ jobs: python -m pip install --upgrade pip python -m pip install git+https://github.com/xbmc/addon-check.git - - name: Kodi Add-on Checker (Jarvis) - id: kodi-addon-checker-jarvis + - name: Kodi Add-on Checker (Nexus) + id: kodi-addon-checker-nexus run: | - kodi-addon-checker ${{ github.event.repository.name }} --branch=jarvis - - - name: Staging for Matrix - run: | - git reset - git checkout . - git clean -fdx - git apply .patches/matrix.patch - working-directory: ${{ github.event.repository.name }} - - - name: Kodi Add-on Checker (Matrix) - id: kodi-addon-checker-matrix - run: | - kodi-addon-checker ${{ github.event.repository.name }} --branch=matrix + kodi-addon-checker ${{ github.event.repository.name }} --branch=nexus diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 5e34e9d..86ab461 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -26,12 +26,13 @@ jobs: fi - name: Checkout Add-on - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} - name: Install dependencies run: | + sudo apt-get update sudo apt-get install libxml2-utils xmlstarlet zip - name: Get Variables @@ -46,8 +47,8 @@ jobs: echo ::set-output name=version::$version working-directory: ${{ github.event.repository.name }} - - name: Create Zip (Jarvis) - id: zip-jarvis + - name: Create Zip (Nexus) + id: zip-nexus run: | git reset git checkout . @@ -62,25 +63,6 @@ jobs: echo ::set-output name=filename::$filename working-directory: ${{ github.event.repository.name }} - - name: Create Zip (Matrix) - id: zip-matrix - run: | - git reset - git checkout . - git clean -fdx - git apply .patches/matrix.patch - mv .git .. - rm -rf .??* - rm *.md - xmlstarlet ed -L -u '/addon/@version' -v "${{ steps.variables.outputs.version }}+matrix.1" addon.xml - version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - filename=${{ github.event.repository.name }}-${version}.zip - cd .. - zip -r $filename ${{ github.event.repository.name }} - mv .git ${{ github.event.repository.name }} - echo ::set-output name=filename::$filename - working-directory: ${{ github.event.repository.name }} - - name: Create Release id: create-release uses: actions/create-release@v1 @@ -93,24 +75,13 @@ jobs: draft: false prerelease: ${{ steps.release.outputs.pre-release }} - - name: Upload Zip (Jarvis) - id: upload-jarvis - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-jarvis.outputs.filename }} - asset_path: ${{ steps.zip-jarvis.outputs.filename }} - asset_content_type: application/zip - - - name: Upload Zip (Matrix) - id: upload-matrix + - name: Upload Zip (Nexus) + id: upload-nexus uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-matrix.outputs.filename }} - asset_path: ${{ steps.zip-matrix.outputs.filename }} + asset_name: ${{ steps.zip-nexus.outputs.filename }} + asset_path: ${{ steps.zip-nexus.outputs.filename }} asset_content_type: application/zip diff --git a/.github/workflows/submit-release.yml b/.github/workflows/submit-release.yml index ccbf258..739637c 100644 --- a/.github/workflows/submit-release.yml +++ b/.github/workflows/submit-release.yml @@ -19,18 +19,17 @@ jobs: steps: - name: Checkout Add-on - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ${{ github.event.repository.name }} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt-get install libxml2-utils xmlstarlet python -m pip install --upgrade pip python -m pip install git+https://github.com/romanvm/kodi-addon-submitter.git @@ -49,38 +48,10 @@ jobs: git commit -m "Remove unwanted files" working-directory: ${{ github.event.repository.name }} - - name: Submit to Official Repository (Jarvis) - id: submit-jarvis + - name: Submit to Official Repository (Nexus) + id: submit-nexus run: | - submit-addon -r repo-scripts -b jarvis --pull-request ${{ github.event.repository.name }} - working-directory: ${{ github.event.repository.name }} - env: - GH_USERNAME: anxdpanic - GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }} - EMAIL: anxdpanic@users.noreply.github.com - - - name: Staging for Official Repository (Matrix) - id: stage-matrix - run: | - git reset --hard ${{ github.sha }} - git checkout . - git clean -fdx - git apply .patches/matrix.patch - mv .git .. - rm -rf .??* - mv ../.git . - rm *.md - rm changelog.txt - version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - xmlstarlet ed -L -u '/addon/@version' -v "${version}+matrix.1" addon.xml - git add . - git commit -m "Kodi 19 Patch" - working-directory: ${{ github.event.repository.name }} - - - name: Submit to Official Repository (Matrix) - id: submit-matrix - run: | - submit-addon -r repo-scripts -b matrix --pull-request ${{ github.event.repository.name }} + submit-addon -r repo-scripts -b nexus --pull-request ${{ github.event.repository.name }} working-directory: ${{ github.event.repository.name }} env: GH_USERNAME: anxdpanic From e4e827eb114cdcc585f293962c3c9093b3459bc6 Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:47:02 -0500 Subject: [PATCH 6/7] delete unused patch --- .patches/matrix.patch | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .patches/matrix.patch diff --git a/.patches/matrix.patch b/.patches/matrix.patch deleted file mode 100644 index 2f9b4a4..0000000 --- a/.patches/matrix.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6035aa2ee9034b17ff4f40a6c36ebd46a1ba1f2d Mon Sep 17 00:00:00 2001 -From: anxdpanic -Date: Fri, 14 Feb 2020 19:30:14 -0500 -Subject: [PATCH] =?UTF-8?q?=EF=BB=BFmatrix=20repository=20requirements?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - ---- - addon.xml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/addon.xml b/addon.xml -index 00b47bc..bf90ca3 100644 ---- a/addon.xml -+++ b/addon.xml -@@ -3,7 +3,7 @@ - -- -+ - -- -+ - - - --- -2.26.2.windows.1 - From 074caf789e39b309f457965b6529d683ed23702b Mon Sep 17 00:00:00 2001 From: anxdpanic Date: Mon, 27 Feb 2023 15:44:29 -0500 Subject: [PATCH 7/7] 3.0.0 --- addon.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon.xml b/addon.xml index 838ebc7..18ca5d7 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - +