Files
google-labs-jules[bot] d6b995c87b Transform AniScrap to Django: Secure Video Pipeline, Admin Dashboard, and HLS Encryption (#44)
- **Architecture:** Migrated from Flask to Django 6.0.
- **Security:** Implemented AES-128 HLS encryption with secure key serving (`KeyServeView`).
- **Video Pipeline:** Added Celery task `encode_episode` for FFmpeg H.265 transcoding.
- **Admin:** Integrated `django-unfold` for a modern "Cockpit" dashboard with server stats.
- **Frontend:** Created dark-themed Tailwind UI with Plyr/HLS.js player.
- **Database:** Configured for MySQL with `pymysql` (supports SQLite fallback).
- **Ads:** Implemented dynamic AdSlot management system.
- **Legacy:** Archived old codebase to `legacy/`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-18 21:23:59 +00:00

120 lines
4.1 KiB
Python

# Generated by Django 6.0.1 on 2026-01-18 19:30
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Anime",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=255)),
("slug", models.SlugField(blank=True, unique=True)),
("description", models.TextField(blank=True)),
(
"cover_image",
models.ImageField(blank=True, null=True, upload_to="covers/"),
),
("meta_title", models.CharField(blank=True, max_length=255)),
("meta_description", models.TextField(blank=True)),
(
"meta_keywords",
models.CharField(
blank=True, help_text="Comma separated keywords", max_length=255
),
),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name="Episode",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("number", models.FloatField()),
("title", models.CharField(blank=True, max_length=255)),
(
"source_file",
models.FileField(blank=True, null=True, upload_to="raw_uploads/"),
),
(
"hls_playlist",
models.CharField(
blank=True, help_text="Path to master.m3u8", max_length=500
),
),
("is_processed", models.BooleanField(default=False)),
("created_at", models.DateTimeField(auto_now_add=True)),
(
"anime",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="episodes",
to="content.anime",
),
),
],
options={
"ordering": ["number"],
"unique_together": {("anime", "number")},
},
),
migrations.CreateModel(
name="VideoKey",
fields=[
(
"id",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
("key_content", models.BinaryField(help_text="AES-128 Key bytes")),
(
"iv",
models.BinaryField(
blank=True,
help_text="Initialization Vector if needed",
null=True,
),
),
("is_active", models.BooleanField(default=True)),
("created_at", models.DateTimeField(auto_now_add=True)),
(
"episode",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="keys",
to="content.episode",
),
),
],
),
]