« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateAlbumReleaseInfo.js24
-rw-r--r--src/content/dependencies/generateContributionTooltip.js6
-rw-r--r--src/content/dependencies/generateContributionTooltipChronologySection.js4
-rw-r--r--src/content/dependencies/generateReleaseInfoContributionsLine.js6
-rw-r--r--src/content/dependencies/generateTrackReleaseInfo.js12
-rw-r--r--src/content/dependencies/linkContribution.js2
6 files changed, 38 insertions, 16 deletions
diff --git a/src/content/dependencies/generateAlbumReleaseInfo.js b/src/content/dependencies/generateAlbumReleaseInfo.js
index e4c184c0..28227f45 100644
--- a/src/content/dependencies/generateAlbumReleaseInfo.js
+++ b/src/content/dependencies/generateAlbumReleaseInfo.js
@@ -67,17 +67,25 @@ export default {
           {[html.joinChildren]: html.tag('br')},
 
           [
-            relations.artistContributionsLine
-              .slots({stringKey: capsule + '.by'}),
+            relations.artistContributionsLine.slots({
+              stringKey: capsule + '.by',
+              chronologyKind: 'album',
+            }),
 
-            relations.coverArtistContributionsLine
-              .slots({stringKey: capsule + '.coverArtBy'}),
+            relations.coverArtistContributionsLine.slots({
+              stringKey: capsule + '.coverArtBy',
+              chronologyKind: 'coverArt',
+            }),
 
-            relations.wallpaperArtistContributionsLine
-              .slots({stringKey: capsule + '.wallpaperArtBy'}),
+            relations.wallpaperArtistContributionsLine.slots({
+              stringKey: capsule + '.wallpaperArtBy',
+              chronologyKind: 'wallpaperArt',
+            }),
 
-            relations.bannerArtistContributionsLine
-              .slots({stringKey: capsule + '.bannerArtBy'}),
+            relations.bannerArtistContributionsLine.slots({
+              stringKey: capsule + '.bannerArtBy',
+              chronologyKind: 'bannerArt',
+            }),
 
             language.$(capsule, 'released', {
               [language.onlyIfOptions]: ['date'],
diff --git a/src/content/dependencies/generateContributionTooltip.js b/src/content/dependencies/generateContributionTooltip.js
index 5df88121..3a31014d 100644
--- a/src/content/dependencies/generateContributionTooltip.js
+++ b/src/content/dependencies/generateContributionTooltip.js
@@ -21,6 +21,8 @@ export default {
   slots: {
     showExternalLinks: {type: 'boolean'},
     showChronology: {type: 'boolean'},
+
+    chronologyKind: {type: 'string'},
   },
 
   generate: (relations, slots, {html}) =>
@@ -38,7 +40,9 @@ export default {
           relations.externalLinkSection,
 
         slots.showChronology &&
-          relations.chronologySection,
+          relations.chronologySection.slots({
+            kind: slots.chronologyKind,
+          }),
       ],
     }),
 };
diff --git a/src/content/dependencies/generateContributionTooltipChronologySection.js b/src/content/dependencies/generateContributionTooltipChronologySection.js
index 5803b406..ef5c75b4 100644
--- a/src/content/dependencies/generateContributionTooltipChronologySection.js
+++ b/src/content/dependencies/generateContributionTooltipChronologySection.js
@@ -45,10 +45,12 @@ export default {
       validate: v =>
         v.is(
           'album',
+          'bannerArt',
           'coverArt',
           'flash',
           'track',
-          'trackArt'),
+          'trackArt',
+          'wallpaperArt'),
     },
   },
 
diff --git a/src/content/dependencies/generateReleaseInfoContributionsLine.js b/src/content/dependencies/generateReleaseInfoContributionsLine.js
index ed60886b..3e96ed44 100644
--- a/src/content/dependencies/generateReleaseInfoContributionsLine.js
+++ b/src/content/dependencies/generateReleaseInfoContributionsLine.js
@@ -17,11 +17,12 @@ export default {
   },
 
   slots: {
-    stringKey: {type: 'string'},
-
     showContribution: {type: 'boolean', default: true},
     showExternalLinks: {type: 'boolean', default: true},
     showChronology: {type: 'boolean', default: true},
+
+    stringKey: {type: 'string'},
+    chronologyKind: {type: 'string'},
   },
 
   generate(relations, slots, {html, language}) {
@@ -37,6 +38,7 @@ export default {
               showContribution: slots.showContribution,
               showExternalLinks: slots.showExternalLinks,
               showChronology: slots.showChronology,
+              chronologyKind: slots.chronologyKind,
             }))),
     });
   },
diff --git a/src/content/dependencies/generateTrackReleaseInfo.js b/src/content/dependencies/generateTrackReleaseInfo.js
index e234dd5d..8a081046 100644
--- a/src/content/dependencies/generateTrackReleaseInfo.js
+++ b/src/content/dependencies/generateTrackReleaseInfo.js
@@ -54,11 +54,15 @@ export default {
           {[html.joinChildren]: html.tag('br')},
 
           [
-            relations.artistContributionLinks
-              .slots({stringKey: capsule + '.by'}),
+            relations.artistContributionLinks.slots({
+              stringKey: capsule + '.by',
+              chronologyKind: 'track',
+            }),
 
-            relations.coverArtistContributionsLine
-              ?.slots({stringKey: capsule + '.coverArtBy'}),
+            relations.coverArtistContributionsLine?.slots({
+              stringKey: capsule + '.coverArtBy',
+              chronologyKind: 'trackArt',
+            }),
 
             language.$(capsule, 'released', {
               [language.onlyIfOptions]: ['date'],
diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js
index 67a50e5b..c43f31ca 100644
--- a/src/content/dependencies/linkContribution.js
+++ b/src/content/dependencies/linkContribution.js
@@ -29,6 +29,7 @@ export default {
     showChronology: {type: 'boolean', default: false},
 
     preventWrapping: {type: 'boolean', default: true},
+    chronologyKind: {type: 'string'},
   },
 
   generate: (data, relations, slots, {html, language}) =>
@@ -54,6 +55,7 @@ export default {
               relations.tooltip.slots({
                 showExternalLinks: slots.showExternalLinks,
                 showChronology: slots.showChronology,
+                chronologyKind: slots.chronologyKind,
               }),
           });