autotako

Service to monitor moombox for completed livestream downloads to upload for distribution
git clone https://code.alwayswait.ing/autotako.git
Log | Files | Refs

commit f60b975bec55819071d617d9ea68c757ec4d76ac
parent adcb844f59898c3f1b79bb6aeac261cf9478e357
Author: archiveanon <>
Date:   Mon, 10 Mar 2025 10:15:45 +0000

Skip listing jobs with validation errors

We really should do something about this at some point, but
it's not like anyone else is supposed to be using this in
production...

Diffstat:
Msrc/autotako/app.py | 8+++++++-
Msrc/autotako/job_render.py | 7++++++-
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/autotako/app.py b/src/autotako/app.py @@ -59,7 +59,13 @@ def create_app(): async def index(request): async with httpx.AsyncClient() as client: result = await client.get(f"{config.moombox_url}/status") - jobs = msgspec.convert(result.json(), type=list[MoomboxJobInfo]) + + jobs = [] + for serialized_job in result.json(): + try: + jobs.append(msgspec.convert(serialized_job, type=MoomboxJobInfo)) + except msgspec.ValidationError: + pass db = database_ctx.get() cursor = db.cursor() diff --git a/src/autotako/job_render.py b/src/autotako/job_render.py @@ -495,7 +495,12 @@ async def job_auto_monitor(): with attempt: result = await client.get(f"{config.moombox_url}/status") - jobs = msgspec.convert(result.json(), type=list[MoomboxJobInfo]) + jobs = [] + for serialized_job in result.json(): + try: + jobs.append(msgspec.convert(serialized_job, type=MoomboxJobInfo)) + except msgspec.ValidationError: + pass database = database_ctx.get() cursor = database.cursor()