Commit d32b466d authored by David Trattnig's avatar David Trattnig
Browse files

Clear timeslot when it ended. #41

parent ce532118
......@@ -103,6 +103,7 @@ class EngineEventDispatcher():
binding = self.attach(TrackServiceHandler)
binding.subscribe("on_timeslot_start")
binding.subscribe("on_timeslot_end")
binding.subscribe("on_play")
binding.subscribe("on_metadata")
binding.subscribe("on_queue")
......
......@@ -62,6 +62,17 @@ class TrackServiceHandler():
self.playlog.set_timeslot(timeslot)
def on_timeslot_end(self, timeslot):
"""
Called when a timeslot ends.
"""
if timeslot:
self.logger.info(f"Timeslot '{timeslot}' just ended")
self.playlog.set_timeslot(None)
def on_queue(self, entries):
"""
Items have been queued. They are stored to the local playlog, allowing later
......
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