From fdfa77f5c432f7568694470baa4172274b186ab3 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Tue, 11 Jun 2024 12:06:28 -0400 Subject: [PATCH] fix: expose showName instead of title --- program/services.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/program/services.py b/program/services.py index df3a45f2..1d01adbf 100644 --- a/program/services.py +++ b/program/services.py @@ -100,7 +100,7 @@ class ScheduleEntry(TypedDict): is_virtual: bool show_id: int start: str - title: str + show_name: str class TimeslotEntry(TypedDict): @@ -113,16 +113,16 @@ class TimeslotEntry(TypedDict): schedule_id: int show_default_playlist_id: int | None show_id: int + show_name: str start: str - title: str class VirtualTimeslotEntry(TypedDict): end: str is_virtual: Literal[True] show_id: int + show_name: str start: str - title: str def create_timeslot(start: str, end: str, schedule: Schedule) -> TimeSlot: @@ -787,7 +787,7 @@ def make_schedule_entry(*, timeslot_entry: TimeslotEntry) -> ScheduleEntry: "show_id": timeslot_entry["show_id"], "is_virtual": timeslot_entry["is_virtual"], "start": timeslot_entry["start"], - "title": timeslot_entry["title"], + "show_name": timeslot_entry["show_name"], } @@ -808,8 +808,8 @@ def make_timeslot_entry(*, timeslot: TimeSlot) -> TimeslotEntry: "schedule_id": schedule.id, "show_default_playlist_id": show.default_playlist_id, "show_id": show.id, + "show_name": show.name, "start": timeslot.start.strftime("%Y-%m-%dT%H:%M:%S %z"), - "title": f"{show.name} {_('REP')}" if schedule.is_repetition else show.name, } @@ -820,8 +820,8 @@ def make_virtual_timeslot_entry(*, gap_start: datetime, gap_end: datetime) -> Vi "end": gap_end.strftime("%Y-%m-%dT%H:%M:%S %z"), "is_virtual": True, "show_id": RadioSettings.objects.first().fallback_show.id, + "show_name": RadioSettings.objects.first().fallback_default_pool, "start": gap_start.strftime("%Y-%m-%dT%H:%M:%S %z"), - "title": RadioSettings.objects.first().fallback_default_pool, } -- GitLab