Simplify the logic of adding channels to the cache
This commit is contained in:
1 parent
79e685ed0b
commit
23ab930c0d
1 file changed
+4
-4
@@ -217,11 +217,11 @@ class Twitch:
|
|||||||
live_streams: List[Channel] = await self.get_live_streams(
|
live_streams: List[Channel] = await self.get_live_streams(
|
||||||
selected_game, [DROPS_ENABLED_TAG]
|
selected_game, [DROPS_ENABLED_TAG]
|
||||||
)
|
)
|
||||||
# filter out ones we already have
|
# add them, filtering out ones we already have
|
||||||
live_streams = [ch for ch in live_streams if ch.id not in self.channels]
|
|
||||||
for channel in live_streams:
|
for channel in live_streams:
|
||||||
self.channels[channel.id] = channel
|
if channel.id not in self.channels:
|
||||||
channel.display()
|
self.channels[channel.id] = channel
|
||||||
|
channel.display()
|
||||||
# load points
|
# load points
|
||||||
# asyncio.gather(*(channel.claim_bonus() for channel in live_streams))
|
# asyncio.gather(*(channel.claim_bonus() for channel in live_streams))
|
||||||
# Sub to these channel updates
|
# Sub to these channel updates
|
||||||
|
|||||||
Reference in new issue
Block a user