fix (video): Don't pre-load with no channels.

This commit is contained in:
2021-09-28 09:07:03 +03:00
parent 47b29e5400
commit 8e86da4abf

View File

@@ -55,13 +55,14 @@ class video_channels(settings.ChannelList, settings.ListData, settings.Setting):
for guild in client.guilds for guild in client.guilds
if any(channel.members for channel in guild.voice_channels) if any(channel.members for channel in guild.voice_channels)
] ]
rows = cls._table_interface.select_where( if active_guildids:
guildid=active_guildids rows = cls._table_interface.select_where(
) guildid=active_guildids
cache = defaultdict(list) )
for row in rows: cache = defaultdict(list)
cache[row['guildid']].append(row['channelid']) for row in rows:
cls._cache.update(cache) cache[row['guildid']].append(row['channelid'])
cls._cache.update(cache)
@GuildSettings.attach_setting @GuildSettings.attach_setting