Fix loading shows with empty channels.

This commit is contained in:
Matthew Stratford 2021-04-25 17:23:41 +01:00
parent 3f89a3cd32
commit d44d417a06

View file

@ -265,8 +265,10 @@ class Player:
plan = sync(self.api.get_showplan(message))
self.clear_channel_plan()
channel = self.state.get()["channel"]
self.logger.log.info(plan)
if len(plan) > channel:
self.logger.log.debug(plan)
if not isinstance(plan, dict):
return False
if str(channel) in plan.keys():
for plan_item in plan[str(channel)]:
try:
self.add_to_plan(plan_item)