From 3e5c8f731117b01fdf46c4fe066e1c349dee3827 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 25 Mar 2026 11:18:42 -0300 Subject: content, data: Divide Flash Lists By Sides --- src/data/things/Track.js | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'src/data/things/Track.js') diff --git a/src/data/things/Track.js b/src/data/things/Track.js index 5cb6388a..36e3733d 100644 --- a/src/data/things/Track.js +++ b/src/data/things/Track.js @@ -5,7 +5,7 @@ import {colors} from '#cli'; import {input, V} from '#composite'; import find, {keyRefRegex} from '#find'; import {onlyItem} from '#sugar'; -import {sortByDate} from '#sort'; +import {sortByDate, sortFlashesChronologically} from '#sort'; import Thing from '#thing'; import {compareKebabCase} from '#wiki-data'; @@ -884,9 +884,44 @@ export class Track extends Thing { reverse: soupyReverse.input('tracksWhichSample'), }), - featuredInFlashes: reverseReferenceList({ + ownFeaturedInFlashes: reverseReferenceList({ reverse: soupyReverse.input('flashesWhichFeature'), }), + + featuredInFlashes: [ + { + dependencies: ['allReleases'], + compute: (continuation, {allReleases}) => continuation({ + ['#data']: + allReleases.flatMap(track => + track.ownFeaturedInFlashes.map(flash => ({ + flash, + track, + + // These properties are used for the upcoming sort. + act: flash.act, + date: flash.date, + }))), + }), + }, + + { + dependencies: ['#data'], + compute: (continuation, {'#data': data}) => continuation({ + ['#sortedData']: + sortFlashesChronologically(data), + }), + }, + + { + dependencies: ['#sortedData'], + compute: ({'#sortedData': sortedData}) => + sortedData.map(item => ({ + flash: item.flash, + as: item.track, + })), + }, + ], }); static [Thing.yamlDocumentSpec] = { -- cgit 1.3.0-6-gf8a5