feat(metadata): 'manual' metadata provider

This commit is contained in:
DecDuck
2024-12-26 19:54:49 +11:00
parent 38fc6b81df
commit 2f52a16d52
11 changed files with 344 additions and 403 deletions

View File

@ -72,10 +72,25 @@ export class MetadataHandler {
.filter((result) => result.status === "fulfilled")
.map((result) => result.value)
.flat();
return successfulResults;
}
async createGameWithoutMetadata(libraryBasePath: string) {
return await this.createGame(
{
id: "",
name: libraryBasePath,
icon: "",
description: "",
year: 0,
sourceId: "manual",
sourceName: "Manual",
},
libraryBasePath
);
}
async createGame(
result: InternalGameMetadataResult,
libraryBasePath: string
@ -103,6 +118,7 @@ export class MetadataHandler {
try {
metadata = await provider.fetchGame({
id: result.id,
name: result.name,
// wrap in anonymous functions to keep references to this
publisher: (name: string) => this.fetchPublisher(name),
developer: (name: string) => this.fetchDeveloper(name),