mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 08:41:15 +10:00
feat(metadata): 'manual' metadata provider
This commit is contained in:
@ -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),
|
||||
|
||||
Reference in New Issue
Block a user