From d44d417a063d1be819b15ac2524ebc8b6a86c113 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sun, 25 Apr 2021 17:23:41 +0100 Subject: [PATCH] Fix loading shows with empty channels. --- player.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/player.py b/player.py index 23dbcee..bbb6760 100644 --- a/player.py +++ b/player.py @@ -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)