chore: prettier pass

This commit is contained in:
Huskydog9988
2025-04-15 21:46:34 -04:00
parent d361e01eef
commit 87215c4a1e
62 changed files with 247 additions and 236 deletions

View File

@ -7,7 +7,7 @@ export default defineEventHandler(async (h3) => {
if (!allowed) throw createError({ statusCode: 403 });
const enabledMechanisms: AuthMec[] = await applicationSettings.get(
"enabledAuthencationMechanisms"
"enabledAuthencationMechanisms",
);
return enabledMechanisms;

View File

@ -3,9 +3,7 @@ import prisma from "~/server/internal/db/database";
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"game:image:new",
]);
const allowed = await aclManager.allowSystemACL(h3, ["game:image:new"]);
if (!allowed) throw createError({ statusCode: 403 });
const form = await readMultipartFormData(h3);

View File

@ -3,9 +3,7 @@ import prisma from "~/server/internal/db/database";
import libraryManager from "~/server/internal/library";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"game:read",
]);
const allowed = await aclManager.allowSystemACL(h3, ["game:read"]);
if (!allowed) throw createError({ statusCode: 403 });
const query = getQuery(h3);

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"game:update",
]);
const allowed = await aclManager.allowSystemACL(h3, ["game:update"]);
if (!allowed) throw createError({ statusCode: 403 });
const body = await readBody(h3);

View File

@ -3,9 +3,7 @@ import prisma from "~/server/internal/db/database";
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"game:update",
]);
const allowed = await aclManager.allowSystemACL(h3, ["game:update"]);
if (!allowed) throw createError({ statusCode: 403 });
const form = await readMultipartFormData(h3);

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"game:version:delete",
]);
const allowed = await aclManager.allowSystemACL(h3, ["game:version:delete"]);
if (!allowed) throw createError({ statusCode: 403 });
const body = await readBody(h3);

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"game:version:update",
]);
const allowed = await aclManager.allowSystemACL(h3, ["game:version:update"]);
if (!allowed) throw createError({ statusCode: 403 });
const body = await readBody(h3);
@ -30,13 +28,13 @@ export default defineEventHandler(async (h3) => {
versionIndex: versionIndex,
},
select: {
versionIndex: true,
versionName: true,
platform: true,
delta: true,
}
})
)
versionIndex: true,
versionName: true,
platform: true,
delta: true,
},
}),
),
);
return newVersions;

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import libraryManager from "~/server/internal/library";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"import:game:read",
]);
const allowed = await aclManager.allowSystemACL(h3, ["import:game:read"]);
if (!allowed) throw createError({ statusCode: 403 });
const unimportedGames = await libraryManager.fetchAllUnimportedGames();

View File

@ -7,9 +7,7 @@ import type {
} from "~/server/internal/metadata/types";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"import:game:new",
]);
const allowed = await aclManager.allowSystemACL(h3, ["import:game:new"]);
if (!allowed) throw createError({ statusCode: 403 });
const body = await readBody(h3);
@ -30,7 +28,6 @@ export default defineEventHandler(async (h3) => {
statusMessage: "Invalid unimported game path",
});
if (!metadata || !metadata.id || !metadata.sourceId) {
console.log(metadata);
return await metadataHandler.createGameWithoutMetadata(path);

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import metadataHandler from "~/server/internal/metadata";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"import:game:read",
]);
const allowed = await aclManager.allowSystemACL(h3, ["import:game:read"]);
if (!allowed) throw createError({ statusCode: 403 });
const query = getQuery(h3);

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import libraryManager from "~/server/internal/library";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"import:version:read",
]);
const allowed = await aclManager.allowSystemACL(h3, ["import:version:read"]);
if (!allowed) throw createError({ statusCode: 403 });
const query = await getQuery(h3);
@ -15,9 +13,8 @@ export default defineEventHandler(async (h3) => {
statusMessage: "Missing id in request params",
});
const unimportedVersions = await libraryManager.fetchUnimportedVersions(
gameId
);
const unimportedVersions =
await libraryManager.fetchUnimportedVersions(gameId);
if (!unimportedVersions)
throw createError({ statusCode: 400, statusMessage: "Invalid game ID" });

View File

@ -4,9 +4,7 @@ import libraryManager from "~/server/internal/library";
import { parsePlatform } from "~/server/internal/utils/parseplatform";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"import:version:new",
]);
const allowed = await aclManager.allowSystemACL(h3, ["import:version:new"]);
if (!allowed) throw createError({ statusCode: 403 });
const body = await readBody(h3);

View File

@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
import libraryManager from "~/server/internal/library";
export default defineEventHandler(async (h3) => {
const allowed = await aclManager.allowSystemACL(h3, [
"import:version:read",
]);
const allowed = await aclManager.allowSystemACL(h3, ["import:version:read"]);
if (!allowed) throw createError({ statusCode: 403 });
const query = await getQuery(h3);
@ -18,7 +16,7 @@ export default defineEventHandler(async (h3) => {
const preload = await libraryManager.fetchUnimportedVersionInformation(
gameId,
versionName
versionName,
);
if (!preload)
throw createError({

View File

@ -19,4 +19,4 @@ export default defineEventHandler(async (h3) => {
await newsManager.delete(id);
return { success: true };
});
});

View File

@ -27,8 +27,7 @@ export default defineEventHandler(async (h3) => {
take: parseInt(query.limit as string),
skip: parseInt(query.skip as string),
orderBy: orderBy,
...(tags && { tags: tags
.map((e) => e.toString()) }),
...(tags && { tags: tags.map((e) => e.toString()) }),
search: query.search as string,
};

View File

@ -13,9 +13,9 @@ export default defineEventHandler(async (h3) => {
authMecs: {
select: {
mec: true,
}
}
}
},
},
},
});
return users;