Skip to content

Commit

Permalink
Merge pull request #36 from anxdpanic/nexus
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
anxdpanic authored Feb 27, 2023
2 parents 5c6a3bf + 074caf7 commit 4f24855
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 175 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/addon-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
45 changes: 8 additions & 37 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 .
Expand All @@ -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
Expand All @@ -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
39 changes: 5 additions & 34 deletions .github/workflows/submit-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
29 changes: 0 additions & 29 deletions .patches/matrix.patch

This file was deleted.

6 changes: 3 additions & 3 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<addon id="script.common.plugin.cache" name="Common plugin cache" provider-name="anxdpanic, TheCollective" version="2.6.3">
<addon id="script.common.plugin.cache" name="Common plugin cache" provider-name="anxdpanic, TheCollective" version="3.0.0">
<requires>
<import addon="xbmc.python" version="2.24.0"/>
<import addon="xbmc.python" version="3.0.1"/>
</requires>
<extension point="xbmc.service" library="resources/lib/entry_point.py" start="startup"/>
<extension point="xbmc.service" library="resources/lib/entry_point.py"/>
<extension point="xbmc.python.module" library="resources/lib/storage_server/"/>
<extension point="xbmc.addon.metadata">
<news>
Expand Down
65 changes: 22 additions & 43 deletions resources/lib/storage_server/StorageServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:])
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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() + "|"
Expand Down Expand Up @@ -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


Expand Down
Loading

0 comments on commit 4f24855

Please sign in to comment.