style: replace Playtypes[Game] with Playtype

This commit is contained in:
zkldi
2022-04-23 05:55:37 +01:00
parent a5fd3bcb9a
commit 5757348dd6
34 changed files with 131 additions and 109 deletions
+3 -10
View File
@@ -10,6 +10,7 @@ import {
FolderDocument,
Playtypes,
Game,
Playtype,
} from "tachi-common";
import db from "external/mongo/db";
import CreateLogCtx from "lib/logger/logger";
@@ -264,19 +265,11 @@ export function GetGradeLampDistributionForFolders(userID: integer, folders: Fol
return Promise.all(folders.map((f) => GetGradeLampDistributionForFolder(userID, f)));
}
export function CreateFolderID(
query: Record<string, unknown>,
game: Game,
playtype: Playtypes[Game]
) {
export function CreateFolderID(query: Record<string, unknown>, game: Game, playtype: Playtype) {
return `F${fjsh.hash(Object.assign({ game, playtype }, query), "SHA256")}`;
}
export async function GetRecentlyViewedFolders(
userID: integer,
game: Game,
playtype: Playtypes[Game]
) {
export async function GetRecentlyViewedFolders(userID: integer, game: Game, playtype: Playtype) {
const views = await db["recent-folder-views"].find(
{
userID,