diff --git a/app/data/updaters/FestivalUpdater.mjs b/app/data/updaters/FestivalUpdater.mjs index 97625b3..a393540 100644 --- a/app/data/updaters/FestivalUpdater.mjs +++ b/app/data/updaters/FestivalUpdater.mjs @@ -10,8 +10,18 @@ export default class FestivalUpdater extends DataUpdater '$..image.url', ]; - getData() { - return this.splatnet.getFestRecordData(); + async getData() { + let result = await this.splatnet.getFestRecordData(); + + // Get the detailed data for each Splatfest + // TODO: Implement caching for past Splatfests to reduce the number of requests needed. + for (let node of result.data.festRecords.nodes) { + let detailResult = await this.splatnet.getFestDetailData(node.id); + + Object.assign(node, detailResult.data.fest); + } + + return result; } async formatDataForWrite(data) { diff --git a/app/splatnet/SplatNet3Client.mjs b/app/splatnet/SplatNet3Client.mjs index bc490ae..1efbcc3 100644 --- a/app/splatnet/SplatNet3Client.mjs +++ b/app/splatnet/SplatNet3Client.mjs @@ -128,4 +128,8 @@ export default class SplatNet3Client getFestRecordData() { return this.getGraphQLPersistedQuery(1, '44c76790b68ca0f3da87f2a3452de986'); } + + getFestDetailData(festId) { + return this.getGraphQLPersistedQuery(1, '2d661988c055d843b3be290f04fb0db9', { festId }); + } }