« get me outta code hell

data: stub Referenced {Track,Album} Artworks fields - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-13 17:43:16 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-13 17:43:16 -0400
commitdb0fd78ca60fc695f87d1f3adf53967bdae2796f (patch)
treeae34489f92ce669737d2ebce76a9f7f64be12ef7 /src/data/things
parent4793c04918a62189c040c7aade490f7a9a8b8b36 (diff)
data: stub Referenced {Track,Album} Artworks fields
just ordinary reference lists, not used anywhere on website yet
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/album.js29
-rw-r--r--src/data/things/track.js27
2 files changed, 56 insertions, 0 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index e17304d0..539f4fb1 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -217,6 +217,32 @@ export class Album extends Thing {
       }),
     ],
 
+    referencedTrackArtworks: [
+      exitWithoutContribs({
+        contribs: 'coverArtistContribs',
+        value: input.value([]),
+      }),
+
+      referenceList({
+        class: input.value(Track),
+        find: input.value(find.track),
+        data: 'trackData',
+      }),
+    ],
+
+    referencedAlbumArtworks: [
+      exitWithoutContribs({
+        contribs: 'coverArtistContribs',
+        value: input.value([]),
+      }),
+
+      referenceList({
+        class: input.value(Album),
+        find: input.value(find.album),
+        data: 'albumData',
+      }),
+    ],
+
     // Update only
 
     artistData: wikiData({
@@ -384,6 +410,9 @@ export class Album extends Thing {
         transform: parseAdditionalFiles,
       },
 
+      'Referenced Track Artworks': {property: 'referencedTrackArtworks'},
+      'Referenced Album Artworks': {property: 'referencedAlbumArtworks'},
+
       'Franchises': {ignore: true},
 
       'Artists': {
diff --git a/src/data/things/track.js b/src/data/things/track.js
index e3526f1c..586e5f4c 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -319,6 +319,30 @@ export class Track extends Thing {
       }),
     ],
 
+    referencedTrackArtworks: [
+      exitWithoutUniqueCoverArt({
+        value: input.value([]),
+      }),
+
+      referenceList({
+        class: input.value(Track),
+        find: input.value(find.track),
+        data: 'trackData',
+      }),
+    ],
+
+    referencedAlbumArtworks: [
+      exitWithoutUniqueCoverArt({
+        value: input.value([]),
+      }),
+
+      referenceList({
+        class: input.value(Album),
+        find: input.value(find.album),
+        data: 'albumData',
+      }),
+    ],
+
     // Update only
 
     albumData: wikiData({
@@ -482,6 +506,9 @@ export class Track extends Thing {
       'Referenced Tracks': {property: 'referencedTracks'},
       'Sampled Tracks': {property: 'sampledTracks'},
 
+      'Referenced Track Artworks': {property: 'referencedTrackArtworks'},
+      'Referenced Album Artworks': {property: 'referencedAlbumArtworks'},
+
       'Franchises': {ignore: true},
       'Inherit Franchises': {ignore: true},