from django.db import models

class VideoTask(models.Model):
    STATUS_CHOICES = [
        ('pending', 'Pending'),
        ('processing', 'Processing'),
        ('completed', 'Completed'),
        ('failed', 'Failed'),
    ]

    surah_number = models.IntegerField()
    surah_name = models.CharField(max_length=255)
    reciter_identifier = models.CharField(max_length=255)
    reciter_name = models.CharField(max_length=255)
    verse_start = models.IntegerField()
    verse_end = models.IntegerField()
    background_video = models.CharField(max_length=255)
    text_color = models.CharField(max_length=20, default='#FFFFFF')
    status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending')
    output_path = models.CharField(max_length=500, blank=True, null=True)
    error_message = models.TextField(blank=True, null=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def __str__(self):
        return f"{self.surah_name} ({self.verse_start}-{self.verse_end}) - {self.status}"