feat: build schedule events exclusively in playout (#2946)

### Description

Build and use the schedule events only in playout, the events generated
by legacy are not used anymore.

This ensure that we don't have to maintain 2 different implementation in
2 different languages. We still need the php function to run to make
sure the side effects of this function are executed (filling the
schedule in the DB).
This commit is contained in:
Jonas L 2024-04-27 20:09:16 +02:00 committed by GitHub
parent c02502ad9d
commit 40b4fc7f66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 18 deletions

View file

@ -17,7 +17,7 @@ from ..liquidsoap.client import LiquidsoapClient
from ..liquidsoap.models import Info, MessageFormatKind, StreamPreferences, StreamState
from .events import Events, FileEvent, FileEvents
from .liquidsoap import Liquidsoap
from .schedule import get_schedule, receive_schedule
from .schedule import get_schedule
logger = logging.getLogger(__name__)
@ -70,7 +70,7 @@ class PypoFetch(Thread):
logger.debug("handling event %s: %s", command, message)
if command == "update_schedule":
self.schedule_data = receive_schedule(message["schedule"]["media"])
self.schedule_data = get_schedule(self.api_client)
self.process_schedule(self.schedule_data)
elif command == "reset_liquidsoap_bootstrap":
self.set_bootstrap_variables()

View file

@ -15,7 +15,6 @@ from .events import (
WebStreamEvent,
datetime_to_event_key,
event_isoparse,
parse_any_event,
)
@ -213,12 +212,3 @@ def generate_webstream_events(
show_name=show["name"],
)
insert_event(events, schedule_end_event_key, stream_output_end_event)
def receive_schedule(schedule: Dict[str, dict]) -> Events:
events: Dict[str, AnyEvent] = {}
for event_key, event in schedule.items():
events[event_key] = parse_any_event(event)
return events