« get me outta code hell

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:
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/album.js30
-rw-r--r--src/data/things/track.js29
2 files changed, 8 insertions, 51 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index 4a714361..6bfec68c 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -233,30 +233,13 @@ export class Album extends Thing {
       }),
     ],
 
-    referencedTrackArtworks: [
+    referencedArtworks: [
       exitWithoutContribs({
         contribs: 'coverArtistContribs',
         value: input.value([]),
       }),
 
-      referencedArtworkList({
-        class: input.value(Track),
-        find: input.value(find.track),
-        data: 'trackData',
-      }),
-    ],
-
-    referencedAlbumArtworks: [
-      exitWithoutContribs({
-        contribs: 'coverArtistContribs',
-        value: input.value([]),
-      }),
-
-      referencedArtworkList({
-        class: input.value(Album),
-        find: input.value(find.album),
-        data: 'albumData',
-      }),
+      referencedArtworkList(),
     ],
 
     // Update only
@@ -429,13 +412,8 @@ export class Album extends Thing {
         transform: parseAdditionalFiles,
       },
 
-      'Referenced Track Artworks': {
-        property: 'referencedTrackArtworks',
-        transform: parseReferencedArtworks,
-      },
-
-      'Referenced Album Artworks': {
-        property: 'referencedAlbumArtworks',
+      'Referenced Artworks': {
+        property: 'referencedArtworks',
         transform: parseReferencedArtworks,
       },
 
diff --git a/src/data/things/track.js b/src/data/things/track.js
index a1740f87..d86c7635 100644
--- a/src/data/things/track.js
+++ b/src/data/things/track.js
@@ -352,28 +352,12 @@ export class Track extends Thing {
       }),
     ],
 
-    referencedTrackArtworks: [
+    referencedArtworks: [
       exitWithoutUniqueCoverArt({
         value: input.value([]),
       }),
 
-      referencedArtworkList({
-        class: input.value(Track),
-        find: input.value(find.track),
-        data: 'trackData',
-      }),
-    ],
-
-    referencedAlbumArtworks: [
-      exitWithoutUniqueCoverArt({
-        value: input.value([]),
-      }),
-
-      referencedArtworkList({
-        class: input.value(Album),
-        find: input.value(find.album),
-        data: 'albumData',
-      }),
+      referencedArtworkList(),
     ],
 
     // Update only
@@ -540,13 +524,8 @@ export class Track extends Thing {
       'Referenced Tracks': {property: 'referencedTracks'},
       'Sampled Tracks': {property: 'sampledTracks'},
 
-      'Referenced Track Artworks': {
-        property: 'referencedTrackArtworks',
-        transform: parseReferencedArtworks,
-      },
-
-      'Referenced Album Artworks': {
-        property: 'referencedAlbumArtworks',
+      'Referenced Artworks': {
+        property: 'referencedArtworks',
         transform: parseReferencedArtworks,
       },