mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 16:51:15 +10:00
feat: games now have tag support
This commit is contained in:
@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user