« get me outta code hell

content: gAIPTracksChunkItem: fix nonsense .kind accesses - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-10 19:20:17 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-12 17:26:46 -0300
commitad671f2df1f62de58448a765b6fde23a19737f6c (patch)
tree80d96bd73f85b191890d032fd8b69497de84daf8
parentd16f20aa14c65aef8dcd49ee56bae933b2487b13 (diff)
content: gAIPTracksChunkItem: fix nonsense .kind accesses
-rw-r--r--src/content/dependencies/generateArtistInfoPageTracksChunkItem.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
index e7cba684..03ca2ef5 100644
--- a/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
+++ b/src/content/dependencies/generateArtistInfoPageTracksChunkItem.js
@@ -1,4 +1,5 @@
 import {empty} from '#sugar';
+import {isArtistContribution, isContributorContribution} from '#wiki-data';
 
 export default {
   contentDependencies: [
@@ -19,11 +20,11 @@ export default {
 
     const creditedAsArtist =
       contribs
-        .some(contrib => contrib.kind === 'artist');
+        .some(isArtistContribution);
 
     const creditedAsContributor =
       contribs
-        .some(contrib => contrib.kind === 'contributor');
+        .some(isContributorContribution);
 
     const annotatedContribs =
       contribs
@@ -31,11 +32,11 @@ export default {
 
     const annotatedArtistContribs =
       annotatedContribs
-        .filter(contrib => contrib.kind === 'artist');
+        .filter(isArtistContribution);
 
     const annotatedContributorContribs =
       annotatedContribs
-        .filter(contrib => contrib.kind === 'contributor');
+        .filter(isContributorContribution);
 
     // Don't display annotations associated with crediting in the
     // Contributors field if the artist is also credited as an Artist