handle missing preview

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-02-17 09:02:42 +01:00
parent 0d0996878d
commit 71afd3fb6f
2 changed files with 14 additions and 12 deletions
+12 -11
View File
@@ -48,17 +48,18 @@ TBD
- remove requirements: `clip`, `open-clip`
- update `requirements`
- **Fixes**
- fix: handle `clip` installer doing unwanted `setuptools` update
- fix: cleanup for `uv` installer fallback
- fix: add metadata restore to always-on scripts
- fix: improve wildcard weights parsing, thanks @Tillerz
- fix: ui gallery cache recursive cleanup, thanks @awsr
- fix: main results pane sizing
- fix: `anima` model detection
- fix: lora unwanted unload
- fix: improve preview error handler
- fix: gallery over remote/unsecure connections
- fix: ltx2-i2v
- handle `clip` installer doing unwanted `setuptools` update
- cleanup for `uv` installer fallback
- add metadata restore to always-on scripts
- improve wildcard weights parsing, thanks @Tillerz
- ui gallery cache recursive cleanup, thanks @awsr
- main results pane sizing
- model detection for `anima`
- lora unwanted unload
- improve preview error handler
- gallery over remote/unsecure connections
- ltx2-i2v
- handle missing preview image
## Update for 2026-02-04
+2 -1
View File
@@ -60,7 +60,8 @@ def init_api():
if filename is None or len(filename) == 0:
return JSONResponse({ "error": "no filename" }, status_code=400)
if not os.path.exists(filename) or not os.path.isfile(filename):
return JSONResponse({ "error": f"file {filename}: not found" }, status_code=404)
return FileResponse('html/missing.png', headers={"Accept-Ranges": "bytes"})
# return JSONResponse({ "error": f"file {filename}: not found" }, status_code=404)
if filename.startswith('html/') or filename.startswith('models/'):
return FileResponse(filename, headers={"Accept-Ranges": "bytes"})
if not any(Path(folder).absolute() in Path(filename).absolute().parents for folder in allowed_dirs):