feat: games now have tag support

This commit is contained in:
Huskydog9988
2025-05-11 12:52:00 -04:00
parent a8ee27eea9
commit dad2161754
8 changed files with 125 additions and 23 deletions

View File

@ -110,6 +110,30 @@ export class MetadataHandler {
);
}
private parseTags(tags: string[]) {
const results: {
where: {
name: string;
};
create: {
name: string;
};
}[] = [];
tags.forEach((t) =>
results.push({
where: {
name: t,
},
create: {
name: t,
},
}),
);
return results;
}
async createGame(
result: InternalGameMetadataResult,
libraryBasePath: string,
@ -173,6 +197,10 @@ export class MetadataHandler {
connect: metadata.developers,
},
tags: {
connectOrCreate: this.parseTags(metadata.tags),
},
libraryBasePath,
},
});