« get me outta code hell

content: generateAlbumChronologyLinks - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateAlbumInfoPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-12 14:50:11 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:32:58 -0300
commita7260373aea3ad95ba21e6aba979db0f53e2fe3f (patch)
tree127def116198b87ef314af47bddba4965a6b3c61 /src/content/dependencies/generateAlbumInfoPage.js
parent31429e48f7f4ce41556dee91165d0729791652e8 (diff)
content: generateAlbumChronologyLinks
Diffstat (limited to 'src/content/dependencies/generateAlbumInfoPage.js')
-rw-r--r--src/content/dependencies/generateAlbumInfoPage.js43
1 files changed, 3 insertions, 40 deletions
diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js
index 02854a16..1d0f6549 100644
--- a/src/content/dependencies/generateAlbumInfoPage.js
+++ b/src/content/dependencies/generateAlbumInfoPage.js
@@ -1,8 +1,5 @@
-import {sortAlbumsTracksChronologically} from '#sort';
 import {empty} from '#sugar';
 
-import getChronologyRelations from '../util/getChronologyRelations.js';
-
 export default {
   contentDependencies: [
     'generateAlbumAdditionalFilesList',
@@ -15,14 +12,13 @@ export default {
     'generateAlbumSocialEmbed',
     'generateAlbumStyleRules',
     'generateAlbumTrackList',
-    'generateChronologyLinks',
+    'generateAlbumChronologyLinks',
     'generateCommentarySection',
     'generateContentHeading',
     'generatePageLayout',
     'linkAlbum',
     'linkAlbumCommentary',
     'linkAlbumGallery',
-    'linkArtist',
     'linkTrack',
     'transformContent',
   ],
@@ -42,37 +38,11 @@ export default {
     relations.socialEmbed =
       relation('generateAlbumSocialEmbed', album);
 
-    relations.coverArtistChronologyContributions =
-      getChronologyRelations(album, {
-        contributions: album.coverArtistContribs ?? [],
-
-        linkArtist: artist => relation('linkArtist', artist),
-
-        linkThing: trackOrAlbum =>
-          (trackOrAlbum.album
-            ? relation('linkTrack', trackOrAlbum)
-            : relation('linkAlbum', trackOrAlbum)),
-
-        getThings(artist) {
-          const getDate = thing => thing.coverArtDate ?? thing.date;
-
-          const things =
-            ([
-              artist.albumCoverArtistContributions,
-              artist.trackCoverArtistContributions,
-            ]).flat()
-              .map(({thing}) => thing)
-              .filter(getDate);
-
-          return sortAlbumsTracksChronologically(things, {getDate});
-        },
-      });
-
     relations.albumNavAccent =
       relation('generateAlbumNavAccent', album, null);
 
     relations.chronologyLinks =
-      relation('generateChronologyLinks');
+      relation('generateAlbumChronologyLinks', album);
 
     relations.secondaryNav =
       relation('generateAlbumSecondaryNav', album);
@@ -249,14 +219,7 @@ export default {
         ],
 
         navContent:
-          relations.chronologyLinks.slots({
-            chronologyInfoSets: [
-              {
-                headingString: 'misc.chronology.heading.coverArt',
-                contributions: relations.coverArtistChronologyContributions,
-              },
-            ],
-          }),
+          relations.chronologyLinks,
 
         banner: relations.banner ?? null,
         bannerPosition: 'top',