fix(civitai): surface missing-model diagnostics and anchor image-page URL parsing

- Return the ResourceNotFoundError detail from get_civitai_versions and
  get_model_versions_status instead of a bare "Model not found", and let
  the download modal display the server-provided message
- Anchor extract_civitai_image_id / extractCivitaiImageId to
  ^/images/<id> so API paths and partial numeric IDs are rejected, same
  as the model-page parsing fix in #1140
This commit is contained in:
Will Miao
2026-10-09 08:12:56 +08:00
parent 01ffda7303
commit 18f3208468
9 changed files with 99 additions and 8 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ def extract_civitai_image_id(url: str | None) -> str | None:
if parsed is None:
return None
path_match = re.search(r"/images/(\d+)", parsed.path)
path_match = re.match(r"^/images/(\d+)(?:/|$)", parsed.path)
if not path_match:
return None