« get me outta code hell

content: chronology labels in release info lines - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-18 11:36:28 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:16 -0300
commitf5fdcf8c5e47249e2a807203dd58b8b4819f8791 (patch)
treebc178573a6393e57eceb07fbdc489b1c363ce6cc
parent7a10bac9cb001753467a6e66f2698125ac4c03e7 (diff)
content: chronology labels in release info lines
-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
-rw-r--r--src/strings-default.yaml2
7 files changed, 40 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,
               }),
           });
 
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 63d981df..0958c06c 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -495,10 +495,12 @@ misc:
 
       kind:
         album: "album"
+        bannerArt: "banner art"
         coverArt: "cover art"
         flash: "flash"
         track: "track"
         trackArt: "track art"
+        wallpaperArt: "wallpaper art"
 
   # chronology:
   #