« get me outta code hell

okay so like, hear me out here - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/common
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-01-08 00:15:37 -0400
committer(quasar) nebula <towerofnix@gmail.com>2021-01-08 00:15:37 -0400
commit8a7cb1edff25ba3e612d7c24b07cc776ff8738d6 (patch)
tree3a0fd54a103d340fd2d39f67620daea85eca2682 /common
parent8aa973e5b4c22b34dfa6256f716ff872d8dad042 (diff)
okay so like, hear me out here
this commit isnt QUITE done but its in a working state, and i just had
the scariest vision of accidentally discarding all my work via git
mishap, yknow? even though im not doing anything funky with git! so yall
get this commit early and its goin on line but im not pushing it to the
site til its done. no spoilering yourself (even though ive already
posted most of the cool things in the discord) <3
Diffstat (limited to 'common')
-rw-r--r--common/common.js20
1 files changed, 4 insertions, 16 deletions
diff --git a/common/common.js b/common/common.js
index 6c21dfc..5db5ad9 100644
--- a/common/common.js
+++ b/common/common.js
@@ -79,6 +79,7 @@ const C = {
     CHANGELOG_DIRECTORY: 'changelog',
     FLASH_DIRECTORY: 'flash',
     NEWS_DIRECTORY: 'news',
+    GROUP_DIRECTORY: 'group',
     JS_DISABLED_DIRECTORY: 'js-disabled',
 
     UNRELEASED_TRACKS_DIRECTORY: 'unreleased-tracks',
@@ -123,22 +124,9 @@ const C = {
     // "directories", we just reformat the artist's name.
     getArtistDirectory: artistName => C.getKebabCase(artistName),
 
-    getThingsArtistContributedTo: (artistName, {allTracks, albumData, flashData}) => [
-        ...allTracks.filter(track => [
-            ...track.artists,
-            ...track.contributors,
-            ...track.coverArtists || []
-        ].some(({ who }) => who === artistName)),
-        ...flashData.filter(flash => (flash.contributors || []).some(({ who }) => who === artistName)),
-        ...albumData.filter(album =>
-            (album.coverArtists || []).some(({ who }) => who === artistName))
-    ],
-
-    getArtistNumContributions: (artistName, {allTracks, albumData, flashData}) => (
-        C.getThingsArtistContributedTo(artistName, {allTracks, albumData, flashData}).length
-    ),
-
-    getArtistCommentary: (artistName, {justEverythingMan}) => justEverythingMan.filter(thing => thing.commentary && thing.commentary.replace(/<\/?b>/g, '').includes('<i>' + artistName + ':</i>'))
+    getArtistNumContributions: artist => (artist.tracks.length + artist.albums.length + artist.flashes.length),
+
+    getArtistCommentary: (artist, {justEverythingMan}) => justEverythingMan.filter(thing => thing.commentary && thing.commentary.replace(/<\/?b>/g, '').includes('<i>' + artist.name + ':</i>'))
 };
 
 if (typeof module === 'object') {