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

Clear timeslot when it ended. #41

parent ce532118
No related branches found
No related tags found
No related merge requests found
...@@ -103,6 +103,7 @@ class EngineEventDispatcher(): ...@@ -103,6 +103,7 @@ class EngineEventDispatcher():
binding = self.attach(TrackServiceHandler) binding = self.attach(TrackServiceHandler)
binding.subscribe("on_timeslot_start") binding.subscribe("on_timeslot_start")
binding.subscribe("on_timeslot_end")
binding.subscribe("on_play") binding.subscribe("on_play")
binding.subscribe("on_metadata") binding.subscribe("on_metadata")
binding.subscribe("on_queue") binding.subscribe("on_queue")
......
...@@ -62,6 +62,17 @@ class TrackServiceHandler(): ...@@ -62,6 +62,17 @@ class TrackServiceHandler():
self.playlog.set_timeslot(timeslot) 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): def on_queue(self, entries):
""" """
Items have been queued. They are stored to the local playlog, allowing later Items have been queued. They are stored to the local playlog, allowing later
......
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