« get me outta code hell

content: gAIPChunkItem: first/rereleases with annotation - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-01-11 07:55:11 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-01-11 07:55:11 -0400
commit235daf0b24c9c4fe7977c3b861f65f22381690a8 (patch)
treedf81d8c9c0e1e3fd4003cb936ace3018b50105a3 /src
parent1bc926c8aec32106c96f055a9bf2302f41b85e75 (diff)
content: gAIPChunkItem: first/rereleases with annotation
also simplify the logic for this function pretty nicely
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateArtistInfoPageChunkItem.js22
-rw-r--r--src/strings-default.yaml2
2 files changed, 7 insertions, 17 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageChunkItem.js b/src/content/dependencies/generateArtistInfoPageChunkItem.js
index 8117ca9a..45a39d46 100644
--- a/src/content/dependencies/generateArtistInfoPageChunkItem.js
+++ b/src/content/dependencies/generateArtistInfoPageChunkItem.js
@@ -54,11 +54,7 @@ export default {
                   text: language.$(entryCapsule, 'rerelease.term'),
                   tooltip: slots.rereleaseTooltip,
                 });
-
-              return language.$(workingCapsule, workingOptions);
-            }
-
-            if (!html.isBlank(slots.firstReleaseTooltip)) {
+            } else if (!html.isBlank(slots.firstReleaseTooltip)) {
               workingCapsule += '.firstRelease';
               workingOptions.firstRelease =
                 relations.textWithTooltip.slots({
@@ -66,29 +62,21 @@ export default {
                   text: language.$(entryCapsule, 'firstRelease.term'),
                   tooltip: slots.firstReleaseTooltip,
                 });
-
-              return language.$(workingCapsule, workingOptions);
-            }
-
-            let anyAccent = false;
-
-            if (!empty(slots.otherArtistLinks)) {
-              anyAccent = true;
+            } else if (!empty(slots.otherArtistLinks)) {
               workingCapsule += '.withArtists';
               workingOptions.artists =
                 language.formatConjunctionList(slots.otherArtistLinks);
             }
 
             if (!html.isBlank(slots.annotation)) {
-              anyAccent = true;
               workingCapsule += '.withAnnotation';
               workingOptions.annotation = slots.annotation;
             }
 
-            if (anyAccent) {
-              return language.$(workingCapsule, workingOptions);
-            } else {
+            if (workingCapsule === entryCapsule) {
               return slots.content;
+            } else {
+              return language.$(workingCapsule, workingOptions);
             }
           }),
 
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 909ae043..5ca40b19 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -1330,6 +1330,7 @@ artistPage:
 
       rerelease:
         _: "{ENTRY} ({RERELEASE})"
+        withAnnotation: "{ENTRY} ({ANNOTATION}; {RERELEASE})"
         term: "rerelease"
 
         firstRelease: >-
@@ -1340,6 +1341,7 @@ artistPage:
 
       firstRelease:
         _: "{ENTRY} ({FIRST_RELEASE})"
+        withAnnotation: "{ENTRY} ({ANNOTATION}; {FIRST_RELEASE})"
         term: "first release"
 
         rerelease: >-