From 462d707c1f5c9f30ad07b77d4801e4bea5a96c22 Mon Sep 17 00:00:00 2001 From: David Trattnig <david.trattnig@o94.at> Date: Wed, 28 Oct 2020 14:29:12 +0100 Subject: [PATCH] Docs. #43 #44 --- modules/plugins/trackservice.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/plugins/trackservice.py b/modules/plugins/trackservice.py index b435f273..498593c8 100644 --- a/modules/plugins/trackservice.py +++ b/modules/plugins/trackservice.py @@ -216,10 +216,12 @@ class TrackServiceHandler(): class Playlog: """ Playlog keeps a short history of currently playing entries. It stores the recent - active entries to a local cache `entry_history` being able to manage concurrently playing entries. - + active entries to a local cache `history` being able to manage concurrently playing entries. It also is in charge of resolving relevant meta information of the currently playing entry for the TrackService handler. + + The records are stored in pre-formatted dictionary structure, allowing easy serialization when + posting them to the Engine API. """ config = None logger = None @@ -261,7 +263,8 @@ class Playlog: next_timeslot = self.engine.scheduler.get_next_timeslots(1) if next_timeslot: next_timeslot = next_timeslot[0] - if timeslot: + # A valid timeslot from the scheduler is available + if timeslot: self.assign_fallback_playlist(data, timeslot) data["schedule_id"] = timeslot.schedule_id data["schedule_start"] = timeslot.schedule_start @@ -275,8 +278,8 @@ class Playlog: self.current_timeslot["schedule_end"] = timeslot.schedule_start self.previous_timeslot = self.current_timeslot - else: - # Defaults are not existing timeslot + # Defaults for a not existing timeslot + else: self.assign_fallback_playlist(data, None) data["schedule_id"] = -1 data["show_id"] = -1 @@ -293,7 +296,7 @@ class Playlog: # Fake the end, because the timeslot is actually not existing data["schedule_end"] = datetime.now() + timedelta(hours=1) - + # A valid following timeslot is available if next_timeslot: ns = {} self.assign_fallback_playlist(ns, next_timeslot) -- GitLab