testing something

This commit is contained in:
2026-03-01 12:31:14 +01:00
parent e724dec0b7
commit 6ec08f30f0
7 changed files with 412 additions and 158 deletions

View File

@@ -11,7 +11,8 @@ DEFAULT_STATE = {
},
"image_popup": {
"showing": False,
"image_url": ""
"image_url": "",
"caption": ""
}
}
@@ -54,6 +55,7 @@ def main(args):
return {"status": "success"}
elif route == "push_image":
image_b64 = body.get("image_b64", "")
caption = body.get("caption", "")
image_bytes = base64.b64decode(image_b64)
file_name = f"tv-image-{int(time.time() * 1000)}.jpg"
MINIO_CLIENT.put_object(
@@ -62,6 +64,7 @@ def main(args):
public_url = f"https://content2.reversed.dev/{BUCKET}/{file_name}"
current = _read_state()
current["image_popup"]["image_url"] = public_url
current["image_popup"]["caption"] = caption
current["image_popup"]["showing"] = True
_write_state(current)
return {"status": "success", "image_url": public_url}