From 048e79a1ea83a942579ce89f797795e34cc4199e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 19 May 2024 21:44:18 -0300 Subject: data: TrackSection thing objects Sorry this commit is kind of monolithic! It's difficult to separate out any of the changes since they're all related to track sections' basic functionality. --- test/lib/wiki-data.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/lib') diff --git a/test/lib/wiki-data.js b/test/lib/wiki-data.js index d2d860ce..75b1170a 100644 --- a/test/lib/wiki-data.js +++ b/test/lib/wiki-data.js @@ -13,20 +13,20 @@ export function linkAndBindWikiData(wikiData, { .map(([key, value]) => [key, value.slice()])) : wikiData)); - // If albumData is present, automatically set albums' ownTrackData values - // by resolving track sections' references against the full array. This is - // just a nicety for working with albums throughout tests. + // If albumData is present, automatically set their sections' ownTrackData + // by resolving references against the full array. This is just a nicety + // for working with albums throughout tests. if (inferAlbumsOwnTrackData && wikiData.albumData && wikiData.trackData) { for (const album of wikiData.albumData) { const trackSections = CacheableObject.getUpdateValue(album, 'trackSections'); - const trackRefs = - trackSections.flatMap(section => section.tracks); - - album.ownTrackData = - trackRefs.map(ref => - find.track(ref, wikiData.trackData, {mode: 'error'})); + for (const trackSection of trackSections) { + trackSection.ownTrackData = + CacheableObject.getUpdateValue(trackSection, 'tracks') + .map(ref => + find.track(ref, wikiData.trackData, {mode: 'error'})); + } } } } -- cgit 1.3.0-6-gf8a5