Add preview URL update mechanism for LoRA scanner cache

This commit is contained in:
Will Miao
2025-02-02 23:30:06 +08:00
parent 4b247995d1
commit 8e8b80ddcf
3 changed files with 80 additions and 8 deletions

View File

@@ -84,6 +84,9 @@ class ApiRoutes:
preview_path = await self._save_preview_file(model_path, preview_data, content_type)
await self._update_preview_metadata(model_path, preview_path)
# Update preview URL in scanner cache
await self.scanner.update_preview_in_cache(model_path, preview_path)
return web.json_response({
"success": True,
"preview_url": config.get_preview_static_url(preview_path)