« get me outta code hell

content: don't access referenceType - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkReferencingArtworks.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-07-10 08:51:46 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-10 08:51:46 -0300
commit2f3785bd381685e97e6cb9fe9f3b69976973930d (patch)
treeed1d4d97616bec67701d241ffd83b43028886904 /src/content/dependencies/linkReferencingArtworks.js
parent09cf76c058c7e42274df33661cfb41c2d73609d1 (diff)
content: don't access referenceType
Diffstat (limited to 'src/content/dependencies/linkReferencingArtworks.js')
-rw-r--r--src/content/dependencies/linkReferencingArtworks.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/content/dependencies/linkReferencingArtworks.js b/src/content/dependencies/linkReferencingArtworks.js
index 0cfca4db..6927f230 100644
--- a/src/content/dependencies/linkReferencingArtworks.js
+++ b/src/content/dependencies/linkReferencingArtworks.js
@@ -1,21 +1,14 @@
-import Thing from '#thing';
-
 export default {
   contentDependencies: [
     'linkAlbumReferencingArtworks',
     'linkTrackReferencingArtworks',
   ],
 
-  query: (artwork) => ({
-    referenceType:
-      artwork.thing.constructor[Thing.referenceType],
-  }),
-
-  relations: (relation, query, artwork) => ({
+  relations: (relation, artwork) => ({
     link:
-      (query.referenceType === 'album'
+      (artwork.thing.isAlbum
         ? relation('linkAlbumReferencingArtworks', artwork.thing)
-     : query.referenceType === 'track'
+     : artwork.thing.isTrack
         ? relation('linkTrackReferencingArtworks', artwork.thing)
         : null),
   }),