diff --git a/app/features/leaderboards/LeaderboardRepository.server.ts b/app/features/leaderboards/LeaderboardRepository.server.ts index 554c96424..c6217cf72 100644 --- a/app/features/leaderboards/LeaderboardRepository.server.ts +++ b/app/features/leaderboards/LeaderboardRepository.server.ts @@ -237,6 +237,12 @@ export async function seasonsParticipatedInByUserId(userId: number) { .selectFrom("Skill") .select("season") .where("userId", "=", userId) + .where(({ or, eb }) => + or([ + eb("groupMatchId", "is not", null), + eb("tournamentId", "is not", null), + ]), + ) .groupBy("season") .orderBy("season", "desc") .execute(); diff --git a/app/features/sendouq-match/QMatchRepository.server.ts b/app/features/sendouq-match/QMatchRepository.server.ts index 75e0b7250..09dcf1e27 100644 --- a/app/features/sendouq-match/QMatchRepository.server.ts +++ b/app/features/sendouq-match/QMatchRepository.server.ts @@ -204,6 +204,12 @@ export async function seasonResultPagesByUserId({ .select(({ fn }) => [fn.countAll().as("count")]) .where("userId", "=", userId) .where("season", "=", season) + .where(({ or, eb }) => + or([ + eb("groupMatchId", "is not", null), + eb("tournamentId", "is not", null), + ]), + ) .executeTakeFirstOrThrow(); return Math.ceil((row.count as number) / MATCHES_PER_SEASONS_PAGE); @@ -327,6 +333,12 @@ export async function seasonResultsByUserId({ ]) .where("userId", "=", userId) .where("season", "=", season) + .where(({ or, eb }) => + or([ + eb("groupMatchId", "is not", null), + eb("tournamentId", "is not", null), + ]), + ) .limit(MATCHES_PER_SEASONS_PAGE) .offset(MATCHES_PER_SEASONS_PAGE * (page - 1)) .orderBy("Skill.id", "desc")