From 02273625377b6779bc0de5f92de0b656d136d539 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sat, 22 Jan 2022 19:47:43 +0100 Subject: [PATCH] Fix active drop subone pre-display --- twitch.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/twitch.py b/twitch.py index e78080e..e898778 100644 --- a/twitch.py +++ b/twitch.py @@ -256,18 +256,19 @@ class Twitch: live_streams: List[Channel] = await self.get_live_streams() for channel in live_streams: new_channels.add(channel) - if new_channels: - # there are online streams, so let's pre-display the active drop again, - # but this time with a substracted minute + if any(self.can_watch(channel) for channel in new_channels): + # there are streams we can watch, so let's pre-display the active drop + # again, but this time with a substracted minute active_drop = self.get_active_drop() if active_drop is not None: active_drop.display(countdown=False, subone=True) # add them, filtering out ones we already have for channel in new_channels: - if channel.id not in self.channels: - self.channels[channel.id] = channel + channel_id = channel.id + if channel_id not in self.channels: + self.channels[channel_id] = channel channel.display() - # Sub to these channel updates + # Subscribe to these channel's state updates topics: List[WebsocketTopic] = [ WebsocketTopic( "Channel", "VideoPlayback", channel_id, self.process_stream_state