fix: handle native video thumbnail availability in get_or_create_thumb function

This commit is contained in:
shiyu
2026-05-04 13:51:53 +08:00
parent c2015dd17c
commit 7741c1fe55
2 changed files with 73 additions and 31 deletions
+3
View File
@@ -415,6 +415,9 @@ async def get_or_create_thumb(adapter, adapter_id: int, root: str, rel: str, w:
f"Failed to convert native thumbnail to WebP: {e}, falling back.")
thumb_bytes, mime = None, None
if is_video and getattr(adapter, "native_video_thumbnail_only", False) and not thumb_bytes:
raise HTTPException(404, detail="Native video thumbnail unavailable")
if not thumb_bytes:
if is_video:
async def _maybe_transcoding_thumb() -> Tuple[bytes, str] | None: