mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-29 10:28:04 +03:00
feat: rival-info table
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import db from "external/mongo/db";
|
||||
import type { Game, Playtype, integer } from "tachi-common";
|
||||
|
||||
export async function GetRecentUGPTScores(
|
||||
userID: integer,
|
||||
game: Game,
|
||||
playtype: Playtype,
|
||||
limit = 100
|
||||
) {
|
||||
return db.scores.find(
|
||||
{
|
||||
userID,
|
||||
game,
|
||||
playtype,
|
||||
},
|
||||
{
|
||||
sort: {
|
||||
timeAdded: -1,
|
||||
},
|
||||
limit,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function GetRecentUGPTHighlights(
|
||||
userID: integer,
|
||||
game: Game,
|
||||
playtype: Playtype,
|
||||
limit = 100
|
||||
) {
|
||||
return db.scores.find(
|
||||
{
|
||||
userID,
|
||||
game,
|
||||
playtype,
|
||||
highlight: true,
|
||||
},
|
||||
{
|
||||
sort: {
|
||||
timeAdded: -1,
|
||||
},
|
||||
limit,
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user