d234f8df33
* feat: add store nav and fixes * fix: reduce password requirement & new task error ui * fix: client webtoken fix * fix: delta versions and dockerfile * fix: use setup platforms for filter & display * fix: setup not accounted when returning valid options * feat: tighter delta version support * feat: dl/disk size * feat: offload manifest generation to torrential * fix: bump torrential * feat: remove droplet * feat: bump torrential * feat: convert locales
39 lines
984 B
TypeScript
39 lines
984 B
TypeScript
import prisma from "../../db/database";
|
|
import { ServerGamesResponseSchema } from "../../proto/torrential/proto/manifest_pb";
|
|
import { create } from "@bufbuild/protobuf";
|
|
import { defineQueryProcessor } from "./utils";
|
|
import {
|
|
DropBoundType,
|
|
TorrentialBoundType,
|
|
} from "../../proto/torrential/proto/core_pb";
|
|
|
|
export default defineQueryProcessor({
|
|
queryType: DropBoundType.SERVER_GAMES_QUERY,
|
|
run: async () => {
|
|
// const queryData = fromBinary(ServerGamesQuerySchema, query.data);
|
|
const games = await prisma.game.findMany({
|
|
select: {
|
|
id: true,
|
|
versions: {
|
|
select: {
|
|
versionId: true,
|
|
},
|
|
where: {
|
|
versionPath: {
|
|
not: null,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
return {
|
|
type: TorrentialBoundType.SERVER_GAMES_RESPONSE,
|
|
schema: ServerGamesResponseSchema,
|
|
data: create(ServerGamesResponseSchema, {
|
|
games,
|
|
}),
|
|
};
|
|
},
|
|
});
|