2025-01-18 23:06:34 -06:00
|
|
|
import uuid
|
2025-01-18 21:31:19 -06:00
|
|
|
from django.db import models
|
2025-01-18 23:06:34 -06:00
|
|
|
from . import odysee
|
2025-01-18 21:31:19 -06:00
|
|
|
|
2025-01-23 20:02:28 -06:00
|
|
|
class Tag(models.Model):
|
|
|
|
id = models.CharField(primary_key=True, max_length=512, default=uuid.uuid4, editable=False, db_index=True)
|
|
|
|
name = models.CharField(max_length=256)
|
|
|
|
description = models.TextField()
|
|
|
|
|
2025-01-23 21:15:18 -06:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
2025-01-18 23:06:34 -06:00
|
|
|
class OdyseeChannel(models.Model):
|
2025-01-23 20:02:28 -06:00
|
|
|
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, db_index=True)
|
2025-01-18 23:06:34 -06:00
|
|
|
name = models.CharField(max_length=1024)
|
2025-01-23 23:28:01 -06:00
|
|
|
description = models.TextField()
|
|
|
|
|
2025-01-18 23:06:34 -06:00
|
|
|
handle = models.CharField(max_length=1024)
|
|
|
|
|
2025-01-23 21:15:18 -06:00
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
2025-01-18 23:06:34 -06:00
|
|
|
class OdyseeRelease(models.Model):
|
2025-01-23 20:02:28 -06:00
|
|
|
id = models.CharField(primary_key=True, max_length=512, default=uuid.uuid4, editable=False, db_index=True)
|
|
|
|
channel = models.ForeignKey(OdyseeChannel, on_delete=models.CASCADE, db_index=True)
|
2025-01-18 23:06:34 -06:00
|
|
|
name = models.CharField(max_length=1024)
|
2025-01-18 23:07:52 -06:00
|
|
|
description = models.TextField()
|
2025-01-18 23:06:34 -06:00
|
|
|
url = models.URLField(max_length=512)
|
2025-01-18 23:35:27 -06:00
|
|
|
thumbnail = models.URLField(max_length=512)
|
2025-01-23 20:02:28 -06:00
|
|
|
|
|
|
|
tags = models.ManyToManyField(Tag)
|
2025-01-23 21:15:18 -06:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.name
|