fix: add scene preview image route
This commit is contained in:
@@ -96,6 +96,15 @@ async def dashboard_preview(theme_id: str, ext: str):
|
|||||||
raise HTTPException(404)
|
raise HTTPException(404)
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/scene/{scene_id}/preview.{ext}")
|
||||||
|
async def scene_preview(scene_id: str, ext: str):
|
||||||
|
from models.scene import SCENES_DIR
|
||||||
|
path = SCENES_DIR / scene_id / f"preview.{ext}"
|
||||||
|
if path.exists():
|
||||||
|
return FileResponse(path)
|
||||||
|
raise HTTPException(404)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/scene/{scene_id}", response_class=HTMLResponse)
|
@app.get("/scene/{scene_id}", response_class=HTMLResponse)
|
||||||
async def scene_render(request: Request, scene_id: str):
|
async def scene_render(request: Request, scene_id: str):
|
||||||
from models.scene import scene_manager
|
from models.scene import scene_manager
|
||||||
|
|||||||
Reference in New Issue
Block a user