diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 20:49:26 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-11 20:49:26 -0400 |
commit | 77fc589466fc0c04326231638c5ec6026e7948d4 (patch) | |
tree | dbc019e4f72851bd3fa8fd5195d87fe6f6177f7c /src/data/things/flash.js | |
parent | 3bb0a89e80fddb985cc1fc4775e58b0d4a7445dc (diff) |
data: soupy reverse
Diffstat (limited to 'src/data/things/flash.js')
-rw-r--r-- | src/data/things/flash.js | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/src/data/things/flash.js b/src/data/things/flash.js index 8a3fc374..b143b560 100644 --- a/src/data/things/flash.js +++ b/src/data/things/flash.js @@ -30,6 +30,7 @@ import { referenceList, simpleDate, soupyFind, + soupyReverse, thing, urls, wikiData, @@ -115,11 +116,7 @@ export class Flash extends Thing { // Update only find: soupyFind(), - - // used for withFlashAct (reverse) - flashActData: wikiData({ - class: input.value(FlashAct), - }), + reverse: soupyReverse(), // used for withMatchingContributionPresets (indirectly by Contribution) wikiInfo: thing({ @@ -167,6 +164,25 @@ export class Flash extends Thing { }, }; + static [Thing.reverseSpecs] = { + flashesWhichFeature: { + bindTo: 'flashData', + + referencing: flash => [flash], + referenced: flash => flash.featuredTracks, + }, + + flashContributorContributionsBy: + soupyReverse.contributionsBy('flashData', 'contributorContribs'), + + flashesWithCommentaryBy: { + bindTo: 'flashData', + + referencing: flash => [flash], + referenced: flash => flash.commentatorArtists, + }, + }; + static [Thing.yamlDocumentSpec] = { fields: { 'Flash': {property: 'name'}, @@ -242,11 +258,7 @@ export class FlashAct extends Thing { // Update only find: soupyFind(), - - // used for withFlashSide - flashSideData: wikiData({ - class: input.value(FlashSide), - }), + reverse: soupyReverse(), // Expose only @@ -263,6 +275,15 @@ export class FlashAct extends Thing { }, }; + static [Thing.reverseSpecs] = { + flashActsWhoseFlashesInclude: { + bindTo: 'flashActData', + + referencing: flashAct => [flashAct], + referenced: flashAct => flashAct.flashes, + }, + }; + static [Thing.yamlDocumentSpec] = { fields: { 'Act': {property: 'name'}, @@ -314,6 +335,15 @@ export class FlashSide extends Thing { }, }; + static [Thing.reverseSpecs] = { + flashSidesWhoseActsInclude: { + bindTo: 'flashSideData', + + referencing: flashSide => [flashSide], + referenced: flashSide => flashSide.acts, + }, + }; + static [Thing.getYamlLoadingSpec] = ({ documentModes: {allInOne}, thingConstructors: {Flash, FlashAct}, |