rewrite: Minor bugfixes.

This commit is contained in:
2023-05-23 18:16:12 +03:00
parent f0dd540876
commit 0e1fb84bcb
6 changed files with 13 additions and 10 deletions

View File

@@ -8,3 +8,4 @@ pytz==2021.1
topggpy
psutil
pillow
python-dateutil

Submodule src/gui updated: 2beff63ddc...ba4733a5f0

View File

@@ -267,14 +267,10 @@ class Timer:
await self._voice_update_task
except asyncio.CancelledError:
return
self._voice_update_task = asyncio.create_task(
self._last_voice_update = utc_now()
await asyncio.create_task(
self.channel.edit(name=self.channel_name)
)
try:
await self._voice_update_task
self._last_voice_update = utc_now()
except asyncio.CancelledError:
return
async def status(self):
"""

View File

@@ -416,7 +416,9 @@ class RankCog(LionCog):
# TODO: Temporary measure
season_start = lguild.config.get('season_start').value or datetime(1970, 1, 1)
stat_data = self.bot.get_cog('StatsCog').data
session_rank.stat = (await stat_data.study_times_since(guildid, userid, season_start))[0]
session_rank.stat = (await stat_data.VoiceSessionStat.study_times_since(
guildid, userid, season_start)
)[0]
# session_rank.stat += duration if (rank_type is RankType.VOICE) else guild_xp
else:
session_rank = await self.get_member_rank(guildid, userid)

View File

@@ -569,6 +569,10 @@ class WeeklyMonthlyUI(StatsUI):
if page_type.stat is StatType.VOICE:
model = self.data.VoiceSessionStats
elif page_type.stat is StatType.TEXT:
model = self.bot.get_cog('TextTrackerCog').data.TextSessions
else:
model = self.data.VoiceSessionStats
first_result = await model.table.select_one_where(**data_key).order_by('start_time')
if first_result is None:

View File

@@ -1,9 +1,9 @@
async def setup(bot):
# from .test import TestCog
from .test import TestCog
# from .data import test_data
# bot.db.load_registry(test_data)
# await bot.add_cog(TestCog(bot))
await bot.add_cog(TestCog(bot))
pass