« get me outta code hell

content: remove old chronology links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/util/getChronologyRelations.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-18 14:28:15 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:17 -0300
commit9e361235d7403961a117dc36a3fb4fb04537ef77 (patch)
tree80839c0233e21ba03fc88da538c15fe11be7b0e4 /src/content/util/getChronologyRelations.js
parent32d31bc3a36a77c51441f915440a990604ebbdd3 (diff)
content: remove old chronology links
Diffstat (limited to 'src/content/util/getChronologyRelations.js')
-rw-r--r--src/content/util/getChronologyRelations.js57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/content/util/getChronologyRelations.js b/src/content/util/getChronologyRelations.js
deleted file mode 100644
index c601a990..00000000
--- a/src/content/util/getChronologyRelations.js
+++ /dev/null
@@ -1,57 +0,0 @@
-export default function getChronologyRelations(thing, {
-  contributions,
-  linkArtist,
-  linkThing,
-  getThings,
-}) {
-  // One call to getChronologyRelations is considered "lumping" together all
-  // contributions as carrying equivalent meaning (for example, "artist"
-  // contributions and "contributor" contributions are bunched together in
-  // one call to getChronologyRelations, while "cover artist" contributions
-  // are a separate call). getChronologyRelations prevents duplicates that
-  // carry the same meaning by only using the first instance of each artist
-  // in the contributions array passed to it. It's expected that the string
-  // identifying which kind of contribution ("track" or "cover art") is
-  // shared and applied to all contributions, as providing them together
-  // in one call to getChronologyRelations implies they carry the same
-  // meaning.
-
-  const artistsSoFar = new Set();
-
-  contributions = contributions.filter(({artist}) => {
-    if (artistsSoFar.has(artist)) {
-      return false;
-    } else {
-      artistsSoFar.add(artist);
-      return true;
-    }
-  });
-
-  return contributions.map(({artist}) => {
-    const things = Array.from(new Set(getThings(artist)));
-
-    // Don't show a line if this contribution isn't part of the artist's
-    // chronology at all (usually because this thing isn't dated).
-    const index = things.indexOf(thing);
-    if (index === -1) {
-      return;
-    }
-
-    const previous = things[index - 1];
-    const next = things[index + 1];
-
-    return {
-      index: index + 1,
-      artistDirectory: artist.directory,
-      only: !(previous || next),
-
-      artistLink: linkArtist(artist),
-      previousLink: previous ? linkThing(previous) : null,
-      nextLink: next ? linkThing(next) : null,
-    };
-  }).filter(Boolean)
-    .sort((a, b) =>
-      (a.only === b.only ?  b.index - a.index
-     : a.only            ? +1
-                         : -1))
-}