Fix ugoira zip conversion — convert cached zips before returning
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.
This commit is contained in:
parent
526606c7c5
commit
2f029da916
@ -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():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user