mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-03 20:38:17 +03:00
refactor chartdocument db collections
This commit is contained in:
Generated
+1
-1
@@ -3623,7 +3623,7 @@
|
||||
}
|
||||
},
|
||||
"kamaitachi-common": {
|
||||
"version": "git+https://github.com/zkldi/Kamaitachi-common.git#ed14a981f924c137198e9c53826ddefe2c46c338",
|
||||
"version": "git+https://github.com/zkldi/Kamaitachi-common.git#e6305e07ea09fdf9d773a50ac78336b210a0226c",
|
||||
"from": "git+https://github.com/zkldi/Kamaitachi-common.git",
|
||||
"requires": {
|
||||
"monk": "^7.3.3"
|
||||
|
||||
+37
-2
@@ -11,6 +11,7 @@ import {
|
||||
InviteCodeDocument,
|
||||
MilestoneDocument,
|
||||
NotificationDocument,
|
||||
Playtypes,
|
||||
PrivateUserDocument,
|
||||
PublicAPIKeyDocument,
|
||||
ScoreDocument,
|
||||
@@ -84,12 +85,46 @@ interface GameCollectionFull {
|
||||
|
||||
let GameCollectionPartial: GCPartial = {
|
||||
songs: {},
|
||||
charts: {},
|
||||
// i have to handwrite this out for TS... :(
|
||||
charts: {
|
||||
bms: monkDB.get<ChartDocument<"bms", Playtypes["bms"], `bms:${Playtypes["bms"]}`>>(
|
||||
`charts-bms`
|
||||
),
|
||||
chunithm: monkDB.get<
|
||||
ChartDocument<"chunithm", Playtypes["chunithm"], `chunithm:${Playtypes["chunithm"]}`>
|
||||
>(`charts-chunithm`),
|
||||
ddr: monkDB.get<ChartDocument<"ddr", Playtypes["ddr"], `ddr:${Playtypes["ddr"]}`>>(
|
||||
`charts-ddr`
|
||||
),
|
||||
gitadora: monkDB.get<
|
||||
ChartDocument<"gitadora", Playtypes["gitadora"], `gitadora:${Playtypes["gitadora"]}`>
|
||||
>(`charts-gitadora`),
|
||||
iidx: monkDB.get<ChartDocument<"iidx", Playtypes["iidx"], `iidx:${Playtypes["iidx"]}`>>(
|
||||
`charts-iidx`
|
||||
),
|
||||
jubeat: monkDB.get<
|
||||
ChartDocument<"jubeat", Playtypes["jubeat"], `jubeat:${Playtypes["jubeat"]}`>
|
||||
>(`charts-jubeat`),
|
||||
maimai: monkDB.get<
|
||||
ChartDocument<"maimai", Playtypes["maimai"], `maimai:${Playtypes["maimai"]}`>
|
||||
>(`charts-maimai`),
|
||||
museca: monkDB.get<
|
||||
ChartDocument<"museca", Playtypes["museca"], `museca:${Playtypes["museca"]}`>
|
||||
>(`charts-museca`),
|
||||
popn: monkDB.get<ChartDocument<"popn", Playtypes["popn"], `popn:${Playtypes["popn"]}`>>(
|
||||
`charts-popn`
|
||||
),
|
||||
sdvx: monkDB.get<ChartDocument<"sdvx", Playtypes["sdvx"], `sdvx:${Playtypes["sdvx"]}`>>(
|
||||
`charts-sdvx`
|
||||
),
|
||||
usc: monkDB.get<ChartDocument<"usc", Playtypes["usc"], `usc:${Playtypes["usc"]}`>>(
|
||||
`charts-usc`
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
for (const game of config.supportedGames) {
|
||||
GameCollectionPartial.songs[game] = monkDB.get<SongDocument>(`songs-${game}`);
|
||||
GameCollectionPartial.charts[game] = monkDB.get<ChartDocument>(`charts-${game}`);
|
||||
}
|
||||
|
||||
// a typescript-friendly interface for the database.
|
||||
|
||||
Reference in New Issue
Block a user