Verify decoder integration E2E and fix live metadata probing and mapping

This commit is contained in:
2026-10-12 21:41:26 +02:00
parent cecd5b5625
commit f5cdfa285e
15 changed files with 657 additions and 17 deletions
+16 -3
View File
@@ -7,6 +7,8 @@ import pathlib
import shutil
import sqlite3
import subprocess
import time
import urllib.error
import urllib.request
parser = argparse.ArgumentParser()
@@ -25,9 +27,9 @@ plugins = pathlib.Path('/var/lib/jellyfin/plugins')
old = [p for p in plugins.glob('Enigma2_*') if p.is_dir()]
backup = pathlib.Path('/var/lib/jellyfin/decoder-plugin-backups') / ('plugin-only-' + datetime.datetime.now(datetime.timezone.utc).strftime('%Y%m%dT%H%M%SZ'))
backup.mkdir(mode=0o700)
new = plugins / 'Enigma2_7.0.4.0'
new = plugins / 'Enigma2_7.0.6.0'
metadata = json.loads((old[0] / 'meta.json').read_text())
metadata.update(version='7.0.4.0', status='Active', targetAbi='12.2.0.0')
metadata.update(version='7.0.6.0', status='Active', targetAbi='12.2.0.0')
subprocess.run(['systemctl', 'stop', 'jellyfin'], check=True)
try:
for p in old:
@@ -46,4 +48,15 @@ except Exception:
finally:
subprocess.run(['systemctl', 'start', 'jellyfin'], check=True)
assert hashes() == before, 'Unexpected change outside plugin installation'
print(json.dumps({'plugin': '7.0.4.0', 'backup': str(backup), 'server_configuration_and_wrappers_unchanged': True}))
deadline = time.monotonic() + 45
while True:
try:
installed = json.load(urllib.request.urlopen(urllib.request.Request('http://127.0.0.1:8096/Plugins', headers=headers), timeout=3))
if any(p['Name'] == 'Enigma2' and p['Version'] == '7.0.6.0' and p['Status'] == 'Active' for p in installed):
break
except (urllib.error.URLError, TimeoutError):
pass
if time.monotonic() >= deadline:
raise RuntimeError('Jellyfin did not load the deployed plugin within 45 seconds; backup: ' + str(backup))
time.sleep(1)
print(json.dumps({'plugin': '7.0.6.0', 'backup': str(backup), 'ready': True, 'server_configuration_and_wrappers_unchanged': True}))