Download and cache campaign, benefit, and reward images locally

This commit is contained in:
Joakim Hellsén 2026-02-12 01:34:51 +01:00
commit 55c2273e27
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
7 changed files with 346 additions and 266 deletions

View file

@ -0,0 +1,36 @@
# Generated by Django 6.0.2 on 2026-02-11 22:55
from __future__ import annotations
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
"""Add image_file and image_url fields to RewardCampaign model for storing local file and original URL of campaign images.""" # noqa: E501
dependencies = [
("twitch", "0009_alter_chatbadge_badge_set_and_more"),
]
operations = [
migrations.AddField(
model_name="rewardcampaign",
name="image_file",
field=models.FileField(
blank=True,
help_text="Locally cached reward campaign image served from this site.",
null=True,
upload_to="reward_campaigns/images/",
),
),
migrations.AddField(
model_name="rewardcampaign",
name="image_url",
field=models.URLField(
blank=True,
default="",
help_text="URL to an image representing the reward campaign.",
max_length=500,
),
),
]