sintonia/api/libretimeapi/models/schedule.py

31 lines
1.1 KiB
Python
Raw Normal View History

2020-01-30 14:47:36 +01:00
from django.db import models
from .files import File
class Schedule(models.Model):
starts = models.DateTimeField()
ends = models.DateTimeField()
file = models.ForeignKey(File, models.DO_NOTHING, blank=True, null=True)
2021-05-27 16:23:02 +02:00
stream = models.ForeignKey("Webstream", models.DO_NOTHING, blank=True, null=True)
2020-01-30 14:47:36 +01:00
clip_length = models.DurationField(blank=True, null=True)
fade_in = models.TimeField(blank=True, null=True)
fade_out = models.TimeField(blank=True, null=True)
cue_in = models.DurationField()
cue_out = models.DurationField()
media_item_played = models.BooleanField(blank=True, null=True)
2021-05-27 16:23:02 +02:00
instance = models.ForeignKey("ShowInstance", models.DO_NOTHING)
2020-01-30 14:47:36 +01:00
playout_status = models.SmallIntegerField()
broadcasted = models.SmallIntegerField()
position = models.IntegerField()
def get_owner(self):
return self.instance.get_owner()
class Meta:
managed = False
2021-05-27 16:23:02 +02:00
db_table = "cc_schedule"
2020-01-30 14:47:36 +01:00
permissions = [
2021-05-27 16:23:02 +02:00
("change_own_schedule", "Change the content on their shows"),
("delete_own_schedule", "Delete the content on their shows"),
2020-01-30 14:47:36 +01:00
]