diff --git a/app/database/lazer_user.py b/app/database/lazer_user.py index 6c51e5b..78d2d72 100644 --- a/app/database/lazer_user.py +++ b/app/database/lazer_user.py @@ -315,12 +315,22 @@ class UserResp(UserBase): CountResp.from_db(pc) for pc in await obj.awaitable_attrs.monthly_playcounts ] + if len(u.monthly_playcounts) == 1: + d = u.monthly_playcounts[0].start_date + u.monthly_playcounts.insert( + 0, CountResp(start_date=d - timedelta(days=20), count=0) + ) if "replays_watched_counts" in include: u.replay_watched_counts = [ CountResp.from_db(rwc) for rwc in await obj.awaitable_attrs.replays_watched_counts ] + if len(u.replay_watched_counts) == 1: + d = u.replay_watched_counts[0].start_date + u.replay_watched_counts.insert( + 0, CountResp(start_date=d - timedelta(days=20), count=0) + ) if "achievements" in include: u.user_achievements = [ diff --git a/app/database/rank_history.py b/app/database/rank_history.py index 45d9fa3..403dbca 100644 --- a/app/database/rank_history.py +++ b/app/database/rank_history.py @@ -74,5 +74,7 @@ class RankHistoryResp(BaseModel): ) ).all() data = [result.rank for result in results] + if len(data) != 90: + data.extend([0] * (90 - len(data))) data.reverse() return cls(mode=mode, data=data)