Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pages/admin/library/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ const searchQuery = ref("");

const libraryState = await $dropFetch("/api/v1/admin/library");

console.log(Object.values(libraryState.unimportedGames));

const toImport = ref(
Object.values(libraryState.unimportedGames).flat().length > 0,
);
Expand Down
5 changes: 4 additions & 1 deletion server/api/v1/admin/library/sources/index.delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type } from "arktype";
import { readDropValidatedBody, throwingArktype } from "~/server/arktype";
import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database";
import libraryManager from "~/server/internal/library";

const DeleteLibrarySource = type({
id: "string",
Expand All @@ -16,10 +17,12 @@ export default defineEventHandler<{ body: typeof DeleteLibrarySource.infer }>(

const body = await readDropValidatedBody(h3, DeleteLibrarySource);

return await prisma.library.delete({
await prisma.library.delete({
where: {
id: body.id,
},
});

libraryManager.removeLibrary(body.id);
},
);
4 changes: 2 additions & 2 deletions server/api/v1/client/chunk.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export default defineClientEventHandler(async (h3) => {
game.libraryPath,
versionName,
filename,
{ start, end: end - 1 },
); // end needs to be offset by 1
{ start, end },
);
if (!gameReadStream)
throw createError({
statusCode: 400,
Expand Down