Add image format conversion after downloading box art and campaign images
This commit is contained in:
parent
c092d3089f
commit
51095796e9
2 changed files with 21 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue