corrected generator bug and models

This commit is contained in:
2026-02-06 08:09:55 -03:00
parent 022baa407f
commit 318741d8ca
2 changed files with 35 additions and 23 deletions

View File

@@ -1,7 +1,8 @@
"""
Django ORM Models - GENERATED FILE
Do not edit directly. Regenerate using modelgen.
Do not edit directly. Modify schema/models/*.py and run:
python schema/generate.py --django
"""
import uuid
@@ -12,6 +13,7 @@ class AssetStatus(models.TextChoices):
READY = "ready", "Ready"
ERROR = "error", "Error"
class JobStatus(models.TextChoices):
PENDING = "pending", "Pending"
PROCESSING = "processing", "Processing"
@@ -19,13 +21,14 @@ class JobStatus(models.TextChoices):
FAILED = "failed", "Failed"
CANCELLED = "cancelled", "Cancelled"
class MediaAsset(models.Model):
"""A video/audio file registered in the system."""
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
filename = models.CharField(max_length=500)
file_path = models.CharField(max_length=1000)
status = models.CharField(max_length=20, choices=Status.choices, default=Status.PENDING)
status = models.CharField(max_length=20, choices=AssetStatus.choices, default=AssetStatus.PENDING)
error_message = models.TextField(blank=True, default='')
file_size = models.BigIntegerField(null=True, blank=True)
duration = models.FloatField(null=True, blank=True, default=None)
@@ -89,7 +92,7 @@ class TranscodeJob(models.Model):
output_filename = models.CharField(max_length=500)
output_path = models.CharField(max_length=1000, null=True, blank=True)
output_asset_id = models.UUIDField(null=True, blank=True)
status = models.CharField(max_length=20, choices=Status.choices, default=Status.PENDING)
status = models.CharField(max_length=20, choices=JobStatus.choices, default=JobStatus.PENDING)
progress = models.FloatField(default=0.0)
current_frame = models.IntegerField(null=True, blank=True, default=None)
current_time = models.FloatField(null=True, blank=True, default=None)