feat(model-manager): add "Delete all" gallery button + clearer 401 errors
- Gallery: DELETE /api/gallery/all removes every image under output/; "Delete all" button with in-app confirm and a deleted/failed count. - Downloads: surface a clear, actionable message when CivitAI/HuggingFace returns 401/403 (model requires login/early-access, or the key/token lacks access) instead of a bare error, both at resolve time and during the download stream. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -111,8 +111,11 @@ async def run_download(download_id: int, url: str, headers: dict[str, str],
|
||||
db.update_download(download_id, status="canceled", error="Canceled by user")
|
||||
_cleanup(part_path)
|
||||
except httpx.HTTPStatusError as exc:
|
||||
db.update_download(download_id, status="failed",
|
||||
error=f"HTTP {exc.response.status_code}")
|
||||
code = exc.response.status_code
|
||||
msg = f"HTTP {code}"
|
||||
if code in (401, 403):
|
||||
msg += " — requires login/early-access or invalid API key"
|
||||
db.update_download(download_id, status="failed", error=msg)
|
||||
_cleanup(part_path)
|
||||
except Exception as exc: # noqa: BLE001 - surface any failure to the UI
|
||||
db.update_download(download_id, status="failed", error=str(exc))
|
||||
|
||||
Reference in New Issue
Block a user