Add a subseries field to card metadata (#305)
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 17s

- Add an optional "subseries" field to the card metadata function
- If this is present, it overrides the main series field

#301

Reviewed-on: #305
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
Ethan Lane 2024-07-18 19:46:23 +01:00 committed by Vylpes
parent b0b478e120
commit f28254e407
2 changed files with 2 additions and 1 deletions

View file

@ -11,6 +11,7 @@ export interface CardMetadata {
name: string, name: string,
type: CardRarity, type: CardRarity,
path: string, path: string,
subseries?: string,
} }
export interface DropResult { export interface DropResult {

View file

@ -81,7 +81,7 @@ export default class CardDropHelperMetadata {
public static GenerateDropEmbed(drop: DropResult, quantityClaimed: number, imageFileName: string, claimedBy?: string, currency?: number): EmbedBuilder { public static GenerateDropEmbed(drop: DropResult, quantityClaimed: number, imageFileName: string, claimedBy?: string, currency?: number): EmbedBuilder {
AppLogger.LogSilly("CardDropHelperMetadata/GenerateDropEmbed", `Parameters: drop=${drop.card.id}, quantityClaimed=${quantityClaimed}, imageFileName=${imageFileName}`); AppLogger.LogSilly("CardDropHelperMetadata/GenerateDropEmbed", `Parameters: drop=${drop.card.id}, quantityClaimed=${quantityClaimed}, imageFileName=${imageFileName}`);
const description = drop.series.name; const description = drop.card.subseries ?? drop.series.name;
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle(drop.card.name) .setTitle(drop.card.name)