Skip to content

Commit 4f24855

Browse files
authored
Merge pull request #36 from anxdpanic/nexus
3.0.0
2 parents 5c6a3bf + 074caf7 commit 4f24855

File tree

7 files changed

+82
-175
lines changed

7 files changed

+82
-175
lines changed

.github/workflows/addon-validations.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- name: Set up Python v3.6
20-
uses: actions/setup-python@v2
19+
- name: Set up Python v3.9
20+
uses: actions/setup-python@v3
2121
with:
22-
python-version: '3.6'
22+
python-version: '3.9'
2323

2424
- name: Checkout Add-on
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626
with:
2727
path: ${{ github.event.repository.name }}
2828

@@ -31,20 +31,7 @@ jobs:
3131
python -m pip install --upgrade pip
3232
python -m pip install git+https://github.com/xbmc/addon-check.git
3333
34-
- name: Kodi Add-on Checker (Jarvis)
35-
id: kodi-addon-checker-jarvis
34+
- name: Kodi Add-on Checker (Nexus)
35+
id: kodi-addon-checker-nexus
3636
run: |
37-
kodi-addon-checker ${{ github.event.repository.name }} --branch=jarvis
38-
39-
- name: Staging for Matrix
40-
run: |
41-
git reset
42-
git checkout .
43-
git clean -fdx
44-
git apply .patches/matrix.patch
45-
working-directory: ${{ github.event.repository.name }}
46-
47-
- name: Kodi Add-on Checker (Matrix)
48-
id: kodi-addon-checker-matrix
49-
run: |
50-
kodi-addon-checker ${{ github.event.repository.name }} --branch=matrix
37+
kodi-addon-checker ${{ github.event.repository.name }} --branch=nexus

.github/workflows/make-release.yml

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ jobs:
2626
fi
2727
2828
- name: Checkout Add-on
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
3030
with:
3131
path: ${{ github.event.repository.name }}
3232

3333
- name: Install dependencies
3434
run: |
35+
sudo apt-get update
3536
sudo apt-get install libxml2-utils xmlstarlet zip
3637
3738
- name: Get Variables
@@ -46,8 +47,8 @@ jobs:
4647
echo ::set-output name=version::$version
4748
working-directory: ${{ github.event.repository.name }}
4849

49-
- name: Create Zip (Jarvis)
50-
id: zip-jarvis
50+
- name: Create Zip (Nexus)
51+
id: zip-nexus
5152
run: |
5253
git reset
5354
git checkout .
@@ -62,25 +63,6 @@ jobs:
6263
echo ::set-output name=filename::$filename
6364
working-directory: ${{ github.event.repository.name }}
6465

65-
- name: Create Zip (Matrix)
66-
id: zip-matrix
67-
run: |
68-
git reset
69-
git checkout .
70-
git clean -fdx
71-
git apply .patches/matrix.patch
72-
mv .git ..
73-
rm -rf .??*
74-
rm *.md
75-
xmlstarlet ed -L -u '/addon/@version' -v "${{ steps.variables.outputs.version }}+matrix.1" addon.xml
76-
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
77-
filename=${{ github.event.repository.name }}-${version}.zip
78-
cd ..
79-
zip -r $filename ${{ github.event.repository.name }}
80-
mv .git ${{ github.event.repository.name }}
81-
echo ::set-output name=filename::$filename
82-
working-directory: ${{ github.event.repository.name }}
83-
8466
- name: Create Release
8567
id: create-release
8668
uses: actions/create-release@v1
@@ -93,24 +75,13 @@ jobs:
9375
draft: false
9476
prerelease: ${{ steps.release.outputs.pre-release }}
9577

96-
- name: Upload Zip (Jarvis)
97-
id: upload-jarvis
98-
uses: actions/upload-release-asset@v1
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
with:
102-
upload_url: ${{ steps.create-release.outputs.upload_url }}
103-
asset_name: ${{ steps.zip-jarvis.outputs.filename }}
104-
asset_path: ${{ steps.zip-jarvis.outputs.filename }}
105-
asset_content_type: application/zip
106-
107-
- name: Upload Zip (Matrix)
108-
id: upload-matrix
78+
- name: Upload Zip (Nexus)
79+
id: upload-nexus
10980
uses: actions/upload-release-asset@v1
11081
env:
11182
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11283
with:
11384
upload_url: ${{ steps.create-release.outputs.upload_url }}
114-
asset_name: ${{ steps.zip-matrix.outputs.filename }}
115-
asset_path: ${{ steps.zip-matrix.outputs.filename }}
85+
asset_name: ${{ steps.zip-nexus.outputs.filename }}
86+
asset_path: ${{ steps.zip-nexus.outputs.filename }}
11687
asset_content_type: application/zip

.github/workflows/submit-release.yml

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Add-on
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323
with:
2424
path: ${{ github.event.repository.name }}
2525

2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v3
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030

3131
- name: Install dependencies
3232
run: |
33-
sudo apt-get install libxml2-utils xmlstarlet
3433
python -m pip install --upgrade pip
3534
python -m pip install git+https://github.com/romanvm/kodi-addon-submitter.git
3635
@@ -49,38 +48,10 @@ jobs:
4948
git commit -m "Remove unwanted files"
5049
working-directory: ${{ github.event.repository.name }}
5150

52-
- name: Submit to Official Repository (Jarvis)
53-
id: submit-jarvis
51+
- name: Submit to Official Repository (Nexus)
52+
id: submit-nexus
5453
run: |
55-
submit-addon -r repo-scripts -b jarvis --pull-request ${{ github.event.repository.name }}
56-
working-directory: ${{ github.event.repository.name }}
57-
env:
58-
GH_USERNAME: anxdpanic
59-
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
60-
61-
62-
- name: Staging for Official Repository (Matrix)
63-
id: stage-matrix
64-
run: |
65-
git reset --hard ${{ github.sha }}
66-
git checkout .
67-
git clean -fdx
68-
git apply .patches/matrix.patch
69-
mv .git ..
70-
rm -rf .??*
71-
mv ../.git .
72-
rm *.md
73-
rm changelog.txt
74-
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
75-
xmlstarlet ed -L -u '/addon/@version' -v "${version}+matrix.1" addon.xml
76-
git add .
77-
git commit -m "Kodi 19 Patch"
78-
working-directory: ${{ github.event.repository.name }}
79-
80-
- name: Submit to Official Repository (Matrix)
81-
id: submit-matrix
82-
run: |
83-
submit-addon -r repo-scripts -b matrix --pull-request ${{ github.event.repository.name }}
54+
submit-addon -r repo-scripts -b nexus --pull-request ${{ github.event.repository.name }}
8455
working-directory: ${{ github.event.repository.name }}
8556
env:
8657
GH_USERNAME: anxdpanic

.patches/matrix.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

addon.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2-
<addon id="script.common.plugin.cache" name="Common plugin cache" provider-name="anxdpanic, TheCollective" version="2.6.3">
2+
<addon id="script.common.plugin.cache" name="Common plugin cache" provider-name="anxdpanic, TheCollective" version="3.0.0">
33
<requires>
4-
<import addon="xbmc.python" version="2.24.0"/>
4+
<import addon="xbmc.python" version="3.0.1"/>
55
</requires>
6-
<extension point="xbmc.service" library="resources/lib/entry_point.py" start="startup"/>
6+
<extension point="xbmc.service" library="resources/lib/entry_point.py"/>
77
<extension point="xbmc.python.module" library="resources/lib/storage_server/"/>
88
<extension point="xbmc.addon.metadata">
99
<news>

resources/lib/storage_server/StorageServer.py

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@
3434
except ImportError:
3535
sqlite = None
3636

37-
try:
38-
basestring
39-
except NameError:
40-
basestring = str
41-
42-
PY3 = sys.version_info[0] >= 3
43-
4437

4538
class StorageServer:
4639
def __init__(self, table=None, timeout=24, instance=False):
@@ -297,8 +290,7 @@ def _recv(self, sock):
297290
recv_buffer = sock.recv(self.network_buffer_size)
298291
idle = False
299292
i += 1
300-
if PY3:
301-
recv_buffer = recv_buffer.decode('utf-8', 'ignore')
293+
recv_buffer = recv_buffer.decode('utf-8', 'ignore')
302294
self._log(u"got data : " + str(i) + u" - " + repr(idle) + u" - " +
303295
str(len(data)) + u" + " + str(len(recv_buffer)) + u" | " +
304296
repr(recv_buffer)[len(recv_buffer) - 5:])
@@ -307,15 +299,13 @@ def _recv(self, sock):
307299
elif not idle:
308300
if data[len(data) - 2:] == "\r\n":
309301
content = "COMPLETE\r\n" + (" " * (15 - len("COMPLETE\r\n")))
310-
if PY3:
311-
content = content.encode('utf-8', 'ignore')
302+
content = content.encode('utf-8', 'ignore')
312303
sock.send(content)
313304
idle = True
314305
self._log(u"sent COMPLETE " + str(i))
315306
elif len(recv_buffer) > 0:
316307
content = "ACK\r\n" + (" " * (15 - len("ACK\r\n")))
317-
if PY3:
318-
content = content.encode('utf-8', 'ignore')
308+
content = content.encode('utf-8', 'ignore')
319309
sock.send(content)
320310
idle = True
321311
self._log(u"sent ACK " + str(i))
@@ -351,8 +341,7 @@ def _send(self, sock, data):
351341
send_buffer = data[:self.network_buffer_size]
352342
else:
353343
send_buffer = data + "\r\n"
354-
if PY3:
355-
send_buffer = send_buffer.encode('utf-8', 'ignore')
344+
send_buffer = send_buffer.encode('utf-8', 'ignore')
356345
result = sock.send(send_buffer)
357346
i += 1
358347
idle = False
@@ -361,8 +350,7 @@ def _send(self, sock, data):
361350
status = ""
362351
while status.find("COMPLETE\r\n") == -1 and status.find("ACK\r\n") == -1:
363352
status = sock.recv(15)
364-
if PY3:
365-
status = status.decode('utf-8', 'ignore')
353+
status = status.decode('utf-8', 'ignore')
366354
i -= 1
367355

368356
idle = True
@@ -543,35 +531,28 @@ def _generateKey(self, funct, *args):
543531
for key in sorted(params.keys()):
544532
if key not in ["new_results_function"]:
545533
val = params[key]
546-
if not isinstance(val, basestring):
534+
if not isinstance(val, str):
547535
val = str(val)
548-
if PY3:
549-
if isinstance(key, str):
550-
key = key.encode('utf-8')
551-
if isinstance(val, str):
552-
val = val.encode('utf-8')
553-
key_val_pair = b"'%s'='%s'" % (key, val)
554-
else:
555-
key_val_pair = "'%s'='%s'" % (key, val)
536+
if isinstance(key, str):
537+
key = key.encode('utf-8')
538+
if isinstance(val, str):
539+
val = val.encode('utf-8')
540+
key_val_pair = b"'%s'='%s'" % (key, val)
556541
keyhash.update(key_val_pair)
557542
elif isinstance(params, list):
558-
if PY3:
559-
hash_list = []
560-
for el in params:
561-
if not isinstance(el, basestring):
562-
el = str(el)
563-
if isinstance(el, str):
564-
el = el.encode('utf-8')
565-
hash_list.append(el)
566-
keyhash.update(b",".join([b"%s" % el for el in hash_list]))
567-
else:
568-
keyhash.update(",".join(["%s" % el for el in params]))
543+
hash_list = []
544+
for el in params:
545+
if not isinstance(el, str):
546+
el = str(el)
547+
if isinstance(el, str):
548+
el = el.encode('utf-8')
549+
hash_list.append(el)
550+
keyhash.update(b",".join([b"%s" % el for el in hash_list]))
569551
else:
570-
if not isinstance(params, basestring):
552+
if not isinstance(params, str):
571553
params = str(params)
572-
if PY3:
573-
if isinstance(params, str):
574-
params = params.encode('utf-8')
554+
if isinstance(params, str):
555+
params = params.encode('utf-8')
575556
keyhash.update(params)
576557

577558
name += "|" + keyhash.hexdigest() + "|"
@@ -805,8 +786,6 @@ def _log(self, description):
805786
def to_unicode(text):
806787
if isinstance(text, bytes):
807788
return text.decode('utf-8')
808-
if sys.version_info[0] == 2 and isinstance(text, str):
809-
return text.decode('utf-8')
810789
return text
811790

812791

0 commit comments

Comments
 (0)