From 2f029da9167f4d55d991ba263cbe59f69e9dd991 Mon Sep 17 00:00:00 2001 From: pax Date: Sat, 4 Apr 2026 19:42:36 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20ugoira=20zip=20conversion=20=E2=80=94=20c?= =?UTF-8?q?onvert=20cached=20zips=20before=20returning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously cached .zip files passed the valid media check and were returned without conversion. Now zips are detected and converted to GIF before the general cache check. --- booru_viewer/core/cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/booru_viewer/core/cache.py b/booru_viewer/core/cache.py index df17889..df2f039 100644 --- a/booru_viewer/core/cache.py +++ b/booru_viewer/core/cache.py @@ -91,6 +91,9 @@ async def download_image( gif_path = local.with_suffix(".gif") if gif_path.exists(): return gif_path + # If the zip is cached but not yet converted, convert it now + if local.exists() and zipfile.is_zipfile(local): + return _convert_ugoira_to_gif(local) # Validate cached file isn't corrupt (e.g. HTML error page saved as image) if local.exists():