Cache images instead of serve from Twitch
This commit is contained in:
parent
d434eac74a
commit
b97118cffd
16 changed files with 340 additions and 30 deletions
29
twitch/migrations/0016_add_local_image_fields.py
Normal file
29
twitch/migrations/0016_add_local_image_fields.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
"""Add local image FileFields to models for caching Twitch images."""
|
||||
|
||||
dependencies = [
|
||||
("twitch", "0015_alter_dropbenefitedge_benefit_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="game",
|
||||
name="box_art_file",
|
||||
field=models.FileField(blank=True, null=True, upload_to="games/box_art/"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="dropcampaign",
|
||||
name="image_file",
|
||||
field=models.FileField(blank=True, null=True, upload_to="campaigns/images/"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="dropbenefit",
|
||||
name="image_file",
|
||||
field=models.FileField(blank=True, null=True, upload_to="benefits/images/"),
|
||||
),
|
||||
]
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 5.2.6 on 2025-09-13 00:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('twitch', '0016_add_local_image_fields'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='dropbenefit',
|
||||
name='image_file',
|
||||
field=models.FileField(blank=True, help_text='Locally cached benefit image served from this site.', null=True, upload_to='benefits/images/'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='dropcampaign',
|
||||
name='image_file',
|
||||
field=models.FileField(blank=True, help_text='Locally cached campaign image served from this site.', null=True, upload_to='campaigns/images/'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='game',
|
||||
name='box_art_file',
|
||||
field=models.FileField(blank=True, help_text='Locally cached box art image served from this site.', null=True, upload_to='games/box_art/'),
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue