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 959daa89f461a7e0387fd831c6a6b76c82d53ebe
parent 3c33640db6eadc5b0b39d940cd4fa52b751522cf
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()