replace buffer implementation with a md5 hash. This also adds the ts-md5 library.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user