def wait_seed_api(seed: UUID): seed_id = seed seed = Seed.get(id=seed_id) if seed: return {"text": "Generation done"}, 201 generation = Generation.get(id=seed_id) if not generation: return {"text": "Generation not found"}, 404 elif generation.state == STATE_ERROR: return {"text": "Generation failed"}, 500 return {"text": "Generation running"}, 202
def download_spoiler(seed_id): return Response(Seed.get(id=seed_id).spoiler, mimetype="text/plain")