replace buffer implementation with a md5 hash. This also adds the ts-md5 library.

This commit is contained in:
FurbyOnSteroids
2025-08-16 13:53:56 +02:00
parent 9cafaf5aad
commit f98b811ab9
3 changed files with 10 additions and 7 deletions
+3 -6
View File
@@ -14,17 +14,14 @@ import notificationSystem from "../notifications";
import { GameNotFoundError, type LibraryProvider } from "./provider";
import { logger } from "../logging";
import type { GameModel } from "~/prisma/client/models";
import { Md5 } from "ts-md5";
export function createGameImportTaskId(libraryId: string, libraryPath: string) {
const text = `import:${libraryId}:${libraryPath}`;
// base64 can contain "/" which breaks the URL. So we remove it
return Buffer.from(text, "utf8").toString("base64").replaceAll("/", "");
return Md5.hashStr(`import:${libraryId}:${libraryPath}`);
}
export function createVersionImportTaskId(gameId: string, versionName: string) {
const text = `import:${gameId}:${versionName}`;
// base64 can contain "/" which breaks the URL. So we remove it
return Buffer.from(text, "utf8").toString("base64").replaceAll("/", "");
return Md5.hashStr(`import:${gameId}:${versionName}`);
}
class LibraryManager {