Allow bounded extended probing for slow live TV startup

This commit is contained in:
2026-10-13 08:32:36 +02:00
parent bba36c192f
commit 0a834d863b
12 changed files with 980 additions and 36 deletions
+4 -4
View File
@@ -27,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.7.0'
new = plugins / 'Enigma2_7.0.8.0'
metadata = json.loads((old[0] / 'meta.json').read_text())
metadata.update(version='7.0.7.0', status='Active', targetAbi='12.2.0.0')
metadata.update(version='7.0.8.0', status='Active', targetAbi='12.2.0.0')
subprocess.run(['systemctl', 'stop', 'jellyfin'], check=True)
try:
for p in old:
@@ -52,11 +52,11 @@ 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.7.0' and p['Status'] == 'Active' for p in installed):
if any(p['Name'] == 'Enigma2' and p['Version'] == '7.0.8.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.7.0', 'backup': str(backup), 'ready': True, 'server_configuration_and_wrappers_unchanged': True}))
print(json.dumps({'plugin': '7.0.8.0', 'backup': str(backup), 'ready': True, 'server_configuration_and_wrappers_unchanged': True}))