testing something
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user