« get me outta code hell

content: generateArtistInfoPage{*}: get artworks working again - 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:
author(quasar) nebula <qznebula@protonmail.com>2025-04-08 18:34:52 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-10 16:02:43 -0300
commit9a1cd7327aa21b1d51e87f916d75c3c31fb478cd (patch)
tree59b35397a0739f23072f38f2202561ee709013cc /src/content/dependencies
parent32db75dcff4ea1aca600420644654ef1071ccfd2 (diff)
content: generateArtistInfoPage{*}: get artworks working again
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateArtistInfoPage.js6
-rw-r--r--src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js2
-rw-r--r--src/content/dependencies/generateArtistInfoPageArtworksChunkedList.js7
3 files changed, 8 insertions, 7 deletions
diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js
index 12eaf462..bd5e537a 100644
--- a/src/content/dependencies/generateArtistInfoPage.js
+++ b/src/content/dependencies/generateArtistInfoPage.js
@@ -35,7 +35,7 @@ export default {
     // Artworks are different, though. We intentionally duplicate album data
     // objects when the artist has contributed some combination of cover art,
     // wallpaper, and banner - these each count as a unique contribution.
-    allArtworks:
+    allArtworkThings:
       ([
         artist.albumCoverArtistContributions,
         artist.albumWallpaperArtistContributions,
@@ -43,7 +43,7 @@ export default {
         artist.trackCoverArtistContributions,
       ]).flat()
         .filter(({annotation}) => !annotation?.startsWith('edits for wiki'))
-        .map(({thing}) => thing),
+        .map(({thing}) => thing.thing),
 
     // Banners and wallpapers don't show up in the artist gallery page, only
     // cover art.
@@ -110,7 +110,7 @@ export default {
       relation('generateArtistInfoPageArtworksChunkedList', artist, true),
 
     artworksGroupInfo:
-      relation('generateArtistGroupContributionsInfo', query.allArtworks),
+      relation('generateArtistGroupContributionsInfo', query.allArtworkThings),
 
     artistGalleryLink:
       (query.hasGallery
diff --git a/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js b/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js
index 089cfb8d..2f2fe0c5 100644
--- a/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js
+++ b/src/content/dependencies/generateArtistInfoPageArtworksChunkItem.js
@@ -24,7 +24,7 @@ export default {
 
     trackLink:
       (query.kind === 'track-cover'
-        ? relation('linkTrack', contrib.thing)
+        ? relation('linkTrack', contrib.thing.thing)
         : null),
 
     otherArtistLinks:
diff --git a/src/content/dependencies/generateArtistInfoPageArtworksChunkedList.js b/src/content/dependencies/generateArtistInfoPageArtworksChunkedList.js
index 8b024147..75a4aa5a 100644
--- a/src/content/dependencies/generateArtistInfoPageArtworksChunkedList.js
+++ b/src/content/dependencies/generateArtistInfoPageArtworksChunkedList.js
@@ -27,20 +27,21 @@ export default {
 
     sortContributionsChronologically(
       filteredContributions,
-      sortAlbumsTracksChronologically);
+      sortAlbumsTracksChronologically,
+      {getThing: contrib => contrib.thing.thing});
 
     query.contribs =
       chunkByConditions(filteredContributions, [
         ({date: date1}, {date: date2}) =>
           +date1 !== +date2,
-        ({thing: thing1}, {thing: thing2}) =>
+        ({thing: {thing: thing1}}, {thing: {thing: thing2}}) =>
           (thing1.album ?? thing1) !==
           (thing2.album ?? thing2),
       ]);
 
     query.albums =
       query.contribs
-        .map(contribs => contribs[0].thing)
+        .map(contribs => contribs[0].thing.thing)
         .map(thing => thing.album ?? thing);
 
     return query;