Commit 462d707c authored by David Trattnig's avatar David Trattnig
Browse files

Docs. #43 #44

parent bd710e33
......@@ -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
# Defaults are not existing timeslot
# Defaults for a not existing timeslot
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"] = + timedelta(hours=1)
# A valid following timeslot is available
if next_timeslot:
ns = {}
self.assign_fallback_playlist(ns, next_timeslot)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment