Skip to content

Commit

Permalink
fix score status
Browse files Browse the repository at this point in the history
  • Loading branch information
arily committed Dec 31, 2023
1 parent d5336cf commit 9e7a45f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/server/backend/bancho.py/server/rank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
toUserCompact,
} from '../transforms'
import * as schema from '../drizzle/schema'
import { BanchoPyScoreStatus } from '../enums'
import { RedisNotReadyError, client as redisClient } from './source/redis'
import { useDrizzle, userPriv } from './source/drizzle'
import { prismaClient } from './source/prisma'
Expand All @@ -26,7 +27,7 @@ const logger = Logger.child({ label: 'leaderboard', backend: 'bancho.py' })

const config = _config()
// eslint-disable-next-line n/prefer-global/process
const drizzle = await useDrizzle(schema, { logger: !!process.env.DEV })
const drizzle = useDrizzle(schema, { logger: !!process.env.DEV })

const leaderboardFields = {
id: true,
Expand Down Expand Up @@ -163,7 +164,7 @@ export class DatabaseRankProvider implements Base<Id> {
eq(s.mapMd5, md5),
userPriv(u),
eq(s.mode, toBanchoPyMode(mode, ruleset)),
inArray(s.status, [2, 3])
eq(s.status, BanchoPyScoreStatus.Pick)
))

let q
Expand Down Expand Up @@ -216,7 +217,7 @@ export class DatabaseRankProvider implements Base<Id> {
eq(schema.beatmaps.md5, md5),
userPriv(schema.users),
eq(schema.scores.mode, toBanchoPyMode(mode, ruleset)),
inArray(schema.scores.status, [2, 3]),
eq(schema.scores.status, BanchoPyScoreStatus.Pick),
].filter(TSFilter)
))

Expand Down

0 comments on commit 9e7a45f

Please sign in to comment.