« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/things/album.js14
-rw-r--r--src/data/things/track.js8
-rw-r--r--src/replacer.js20
3 files changed, 39 insertions, 3 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 5f1788f8..6bf683c5 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -348,7 +348,12 @@ export class Album extends Thing {
 
   static [Thing.findSpecs] = {
     album: {
-      referenceTypes: ['album', 'album-commentary', 'album-gallery'],
+      referenceTypes: [
+        'album',
+        'album-commentary',
+        'album-gallery',
+      ],
+
       bindTo: 'albumData',
 
       getMatchableNames: album =>
@@ -358,7 +363,12 @@ export class Album extends Thing {
     },
 
     albumWithArtwork: {
-      referenceTypes: ['album'],
+      referenceTypes: [
+        'album',
+        'album-referencing-artworks',
+        'album-referenced-artworks',
+      ],
+
       bindTo: 'albumData',
 
       include: album =>
diff --git a/src/data/things/track.js b/src/data/things/track.js
index ff4750db..af2206f0 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -600,6 +600,7 @@ export class Track extends Thing {
   static [Thing.findSpecs] = {
     track: {
       referenceTypes: ['track'],
+
       bindTo: 'trackData',
 
       getMatchableNames: track =>
@@ -626,7 +627,12 @@ export class Track extends Thing {
     },
 
     trackWithArtwork: {
-      referenceTypes: ['track'],
+      referenceTypes: [
+        'track',
+        'track-referencing-artworks',
+        'track-referenced-artworks',
+      ],
+
       bindTo: 'trackData',
 
       include: track =>
diff --git a/src/replacer.js b/src/replacer.js
index e3f5623e..68361488 100644
--- a/src/replacer.js
+++ b/src/replacer.js
@@ -26,6 +26,16 @@ export const replacerSpec = {
     link: 'linkAlbumGallery',
   },
 
+  'album-referenced-artworks': {
+    find: 'albumWithArtwork',
+    link: 'linkAlbumReferencedArtworks',
+  },
+
+  'album-referencing-artworks': {
+    find: 'albumWithArtwork',
+    link: 'linkAlbumReferencingArtworks',
+  },
+
   'artist': {
     find: 'artist',
     link: 'linkArtist',
@@ -144,6 +154,16 @@ export const replacerSpec = {
     find: 'track',
     link: 'linkTrackDynamically',
   },
+
+  'track-referenced-artworks': {
+    find: 'trackWithArtwork',
+    link: 'linkTrackReferencedArtworks',
+  },
+
+  'track-referencing-artworks': {
+    find: 'trackWithArtwork',
+    link: 'linkTrackReferencingArtworks',
+  },
 };
 
 // Syntax literals.