Database-level multi-library support #48 (#58)

* feat: start of library backends

* feat: update backend routes and create initializer

* feat: add legacy library creation

* fix: resolve frontend type errors

* fix: runtime errors

* fix: lint
This commit is contained in:
DecDuck
2025-06-01 16:05:05 +10:00
committed by GitHub
parent 490afd0bb7
commit 3e5c3678d5
21 changed files with 664 additions and 298 deletions

View File

@ -97,18 +97,15 @@ export class MetadataHandler {
return successfulResults;
}
async createGameWithoutMetadata(libraryBasePath: string) {
async createGameWithoutMetadata(libraryId: string, libraryPath: string) {
return await this.createGame(
{
id: "",
name: libraryBasePath,
icon: "",
description: "",
year: 0,
name: libraryPath,
sourceId: "manual",
sourceName: "Manual",
},
libraryBasePath,
libraryId,
libraryPath,
);
}
@ -165,8 +162,9 @@ export class MetadataHandler {
}
async createGame(
result: InternalGameMetadataResult,
libraryBasePath: string,
result: { sourceId: string; id: string; name: string },
libraryId: string,
libraryPath: string,
) {
const provider = this.providers.get(result.sourceId);
if (!provider)
@ -231,7 +229,8 @@ export class MetadataHandler {
connectOrCreate: this.parseTags(metadata.tags),
},
libraryBasePath,
libraryId,
libraryPath,
},
});