fix(statistics): Fix several display errors.
This commit is contained in:
2
src/gui
2
src/gui
Submodule src/gui updated: 0153ee258b...24e94d10e2
@@ -126,7 +126,7 @@ class StatsData(Registry):
|
||||
|
||||
@classmethod
|
||||
@log_wrap(action='study_times_between')
|
||||
async def study_times_between(cls, guildid: int, userid: int, *points) -> list[int]:
|
||||
async def study_times_between(cls, guildid: Optional[int], userid: int, *points) -> list[int]:
|
||||
if len(points) < 2:
|
||||
raise ValueError('Not enough block points given!')
|
||||
|
||||
@@ -165,8 +165,8 @@ class StatsData(Registry):
|
||||
return (await cursor.fetchone()[0]) or 0
|
||||
|
||||
@classmethod
|
||||
@log_wrap(action='study_times_between')
|
||||
async def study_times_since(cls, guildid: int, userid: int, *starts) -> int:
|
||||
@log_wrap(action='study_times_since')
|
||||
async def study_times_since(cls, guildid: Optional[int], userid: int, *starts) -> int:
|
||||
if len(starts) < 1:
|
||||
raise ValueError('No starting points given!')
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ async def get_profile_card(bot: LionBot, userid: int, guildid: int):
|
||||
else:
|
||||
next_rank = None
|
||||
|
||||
achievements = (0, 1)
|
||||
achievements = (0, 1, 2, 3)
|
||||
|
||||
card = ProfileCard(
|
||||
user=username,
|
||||
|
||||
@@ -34,7 +34,7 @@ async def get_stats_card(bot: LionBot, userid: int, guildid: int, mode: CardMode
|
||||
# Extract the study times for each period
|
||||
if mode in (CardMode.STUDY, CardMode.VOICE):
|
||||
model = data.VoiceSessionStats
|
||||
refkey = (guildid, userid)
|
||||
refkey = (guildid or None, userid)
|
||||
ref_since = model.study_times_since
|
||||
ref_between = model.study_times_between
|
||||
elif mode is CardMode.TEXT:
|
||||
|
||||
Reference in New Issue
Block a user