Fix active drop subone pre-display
This commit is contained in:
1 parent
db5698843c
commit
0227362537
1 file changed
+7
-6
@@ -256,18 +256,19 @@ class Twitch:
|
|||||||
live_streams: List[Channel] = await self.get_live_streams()
|
live_streams: List[Channel] = await self.get_live_streams()
|
||||||
for channel in live_streams:
|
for channel in live_streams:
|
||||||
new_channels.add(channel)
|
new_channels.add(channel)
|
||||||
if new_channels:
|
if any(self.can_watch(channel) for channel in new_channels):
|
||||||
# there are online streams, so let's pre-display the active drop again,
|
# there are streams we can watch, so let's pre-display the active drop
|
||||||
# but this time with a substracted minute
|
# again, but this time with a substracted minute
|
||||||
active_drop = self.get_active_drop()
|
active_drop = self.get_active_drop()
|
||||||
if active_drop is not None:
|
if active_drop is not None:
|
||||||
active_drop.display(countdown=False, subone=True)
|
active_drop.display(countdown=False, subone=True)
|
||||||
# add them, filtering out ones we already have
|
# add them, filtering out ones we already have
|
||||||
for channel in new_channels:
|
for channel in new_channels:
|
||||||
if channel.id not in self.channels:
|
channel_id = channel.id
|
||||||
self.channels[channel.id] = channel
|
if channel_id not in self.channels:
|
||||||
|
self.channels[channel_id] = channel
|
||||||
channel.display()
|
channel.display()
|
||||||
# Sub to these channel updates
|
# Subscribe to these channel's state updates
|
||||||
topics: List[WebsocketTopic] = [
|
topics: List[WebsocketTopic] = [
|
||||||
WebsocketTopic(
|
WebsocketTopic(
|
||||||
"Channel", "VideoPlayback", channel_id, self.process_stream_state
|
"Channel", "VideoPlayback", channel_id, self.process_stream_state
|
||||||
|
|||||||
Reference in new issue
Block a user