Add image format conversion after downloading box art and campaign images

This commit is contained in:
Joakim Hellsén 2026-03-16 19:27:35 +01:00
commit 51095796e9
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
2 changed files with 21 additions and 1 deletions

View file

@ -7,6 +7,7 @@ from urllib.parse import urlparse
import httpx
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.management import call_command
from django.core.management.base import BaseCommand
from PIL import Image
@ -112,6 +113,15 @@ class Command(BaseCommand):
),
)
# Convert downloaded images to modern formats (WebP, AVIF)
if total_stats["downloaded"] > 0:
self.stdout.write(
self.style.MIGRATE_HEADING(
"\nConverting downloaded images to modern formats...",
),
)
call_command("convert_images_to_modern_formats")
def _download_campaign_images(
self,
client: httpx.Client,