fix(playout): missing live show events (#2087)
This commit is contained in:
parent
be14fb8096
commit
ef1de34111
6 changed files with 132 additions and 4 deletions
|
@ -26,11 +26,13 @@ class Show(models.Model):
|
|||
)
|
||||
|
||||
live_auth_registered = models.BooleanField(
|
||||
default=False,
|
||||
blank=True,
|
||||
null=True,
|
||||
db_column="live_stream_using_airtime_auth",
|
||||
)
|
||||
live_auth_custom = models.BooleanField(
|
||||
default=False,
|
||||
blank=True,
|
||||
null=True,
|
||||
db_column="live_stream_using_custom_auth",
|
||||
|
@ -48,6 +50,10 @@ class Show(models.Model):
|
|||
db_column="live_stream_pass",
|
||||
)
|
||||
|
||||
@property
|
||||
def live_enabled(self) -> bool:
|
||||
return any((self.live_auth_registered, self.live_auth_custom))
|
||||
|
||||
# A show is linkable if it has never been linked before. Once
|
||||
# a show becomes unlinked it can not be linked again.
|
||||
linked = models.BooleanField()
|
||||
|
|
|
@ -15,6 +15,7 @@ class ShowSerializer(serializers.ModelSerializer):
|
|||
"image",
|
||||
"foreground_color",
|
||||
"background_color",
|
||||
"live_enabled",
|
||||
"linked",
|
||||
"linkable",
|
||||
"auto_playlist",
|
||||
|
|
15
api/libretime_api/schedule/tests/models/test_show.py
Normal file
15
api/libretime_api/schedule/tests/models/test_show.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from ...models import Show
|
||||
|
||||
|
||||
def test_show_live_enabled():
|
||||
show = Show(
|
||||
name="My Test Show",
|
||||
description="My test show description",
|
||||
)
|
||||
assert not show.live_enabled
|
||||
|
||||
show.live_auth_registered = True
|
||||
assert show.live_enabled
|
||||
|
||||
show.live_auth_custom = True
|
||||
assert show.live_enabled
|
Loading…
Add table
Add a link
Reference in a new issue