replace btoa with a Buffer implementation, as btoa does not support non-unicode characters.

This commit is contained in:
FurbyOnSteroids
2025-08-16 11:49:52 +02:00
parent a2ea0060cb
commit e21688f14c
+6 -2
View File
@@ -16,11 +16,15 @@ import { logger } from "../logging";
import type { GameModel } from "~/prisma/client/models";
export function createGameImportTaskId(libraryId: string, libraryPath: string) {
return btoa(`import:${libraryId}:${libraryPath}`);
const text = `import:${libraryId}:${libraryPath}`;
// base64 can contain "/" which breaks the URL. So we remove it
return Buffer.from(text, 'utf8').toString('base64').replaceAll("/", "")
}
export function createVersionImportTaskId(gameId: string, versionName: string) {
return btoa(`import:${gameId}:${versionName}`);
const text = `import:${gameId}:${versionName}`;
// base64 can contain "/" which breaks the URL. So we remove it
return Buffer.from(text, 'utf8').toString('base64').replaceAll("/", "")
}
class LibraryManager {