« get me outta code hell

content: generateArtistInfoPageRereleaseTooltip, etc (wip) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-20 00:35:30 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-03-02 08:24:13 -0400
commit5580640828d71d3c17f1c1f3ac51b42a9082d663 (patch)
tree4a27b7ef44107799d81ff31c28736234e8c21e27 /src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
parentb9164020ecf0a8a136c7e45c4c23fe38fc29cd98 (diff)
content: generateArtistInfoPageRereleaseTooltip, etc (wip)
Missing tooltip for first release + link hash target
so this is very much still wip
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageTracksChunkItem.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPageTracksChunkItem.js30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
index 1c311036..8be3f404 100644
--- a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
+++ b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
@@ -5,6 +5,7 @@ export default {
   contentDependencies: [
     'generateArtistInfoPageChunkItem',
     'generateArtistInfoPageOtherArtistLinks',
+    'generateArtistInfoPageRereleaseTooltip',
     'linkTrack',
   ],
 
@@ -62,6 +63,17 @@ export default {
       ];
     }
 
+    query.isRerelease =
+      // It's kinda awkward to perform this chronological sort here,
+      // per track, rather than just reusing the one that's done to
+      // sort all the items on the page altogether... but then, the
+      // sort for the page is actually *a different* sort, on purpsoe.
+      // That sort is according to the dates of the contributions;
+      // this is according to the dates of the tracks. Those can be
+      // different - and it's the latter that determines whether the
+      // track is a rerelease!
+      sortChronologically(query.track.allReleases)[0] !== query.track;
+
     return query;
   },
 
@@ -74,23 +86,17 @@ export default {
 
     otherArtistLinks:
       relation('generateArtistInfoPageOtherArtistLinks', contribs),
+
+    rereleaseTooltip:
+      (query.isRerelease
+        ? relation('generateArtistInfoPageRereleaseTooltip', query.track)
+        : null),
   }),
 
   data: (query) => ({
     duration:
       query.track.duration,
 
-    rerelease:
-      // It's kinda awkward to perform this chronological sort here,
-      // per track, rather than just reusing the one that's done to
-      // sort all the items on the page altogether... but then, the
-      // sort for the page is actually *a different* sort, on purpsoe.
-      // That sort is according to the dates of the contributions;
-      // this is according to the dates of the tracks. Those can be
-      // different - and it's the latter that determines whether the
-      // track is a rerelease!
-      sortChronologically(query.track.allReleases)[0] !== query.track,
-
     contribAnnotations:
       (query.displayedContributions
         ? query.displayedContributions
@@ -101,7 +107,7 @@ export default {
   generate: (data, relations, {html, language}) =>
     relations.template.slots({
       otherArtistLinks: relations.otherArtistLinks,
-      rerelease: data.rerelease,
+      rereleaseTooltip: relations.rereleaseTooltip,
 
       annotation:
         (data.contribAnnotations