Skip to content
Snippets Groups Projects
Commit 462d707c authored by David Trattnig's avatar David Trattnig
Browse files

Docs. #43 #44

parent bd710e33
No related branches found
No related tags found
No related merge requests found
...@@ -216,10 +216,12 @@ class TrackServiceHandler(): ...@@ -216,10 +216,12 @@ class TrackServiceHandler():
class Playlog: class Playlog:
""" """
Playlog keeps a short history of currently playing entries. It stores the recent 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 It also is in charge of resolving relevant meta information of the currently playing entry for
the TrackService handler. the TrackService handler.
The records are stored in pre-formatted dictionary structure, allowing easy serialization when
posting them to the Engine API.
""" """
config = None config = None
logger = None logger = None
...@@ -261,7 +263,8 @@ class Playlog: ...@@ -261,7 +263,8 @@ class Playlog:
next_timeslot = self.engine.scheduler.get_next_timeslots(1) next_timeslot = self.engine.scheduler.get_next_timeslots(1)
if next_timeslot: next_timeslot = next_timeslot[0] 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) self.assign_fallback_playlist(data, timeslot)
data["schedule_id"] = timeslot.schedule_id data["schedule_id"] = timeslot.schedule_id
data["schedule_start"] = timeslot.schedule_start data["schedule_start"] = timeslot.schedule_start
...@@ -275,8 +278,8 @@ class Playlog: ...@@ -275,8 +278,8 @@ class Playlog:
self.current_timeslot["schedule_end"] = timeslot.schedule_start self.current_timeslot["schedule_end"] = timeslot.schedule_start
self.previous_timeslot = self.current_timeslot self.previous_timeslot = self.current_timeslot
else: # Defaults for a not existing timeslot
# Defaults are not existing timeslot else:
self.assign_fallback_playlist(data, None) self.assign_fallback_playlist(data, None)
data["schedule_id"] = -1 data["schedule_id"] = -1
data["show_id"] = -1 data["show_id"] = -1
...@@ -293,7 +296,7 @@ class Playlog: ...@@ -293,7 +296,7 @@ class Playlog:
# Fake the end, because the timeslot is actually not existing # Fake the end, because the timeslot is actually not existing
data["schedule_end"] = datetime.now() + timedelta(hours=1) data["schedule_end"] = datetime.now() + timedelta(hours=1)
# A valid following timeslot is available
if next_timeslot: if next_timeslot:
ns = {} ns = {}
self.assign_fallback_playlist(ns, next_timeslot) self.assign_fallback_playlist(ns, next_timeslot)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment