« get me outta code hell

data: rearrange Album properties, use exitWithoutContribs more - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-09 09:33:14 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-09 09:33:14 -0300
commit3083e006fb8be524ca8e37c3194b78b0bf37861f (patch)
tree4f41b13432cd249c4c410616399a77cbf0741ca7 /src/data
parent9109356037ce98af378765302841c957cc96b8d8 (diff)
data: rearrange Album properties, use exitWithoutContribs more
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/album.js84
1 files changed, 51 insertions, 33 deletions
diff --git a/src/data/things/album.js b/src/data/things/album.js
index dc8d3189..2a8c59ed 100644
--- a/src/data/things/album.js
+++ b/src/data/things/album.js
@@ -59,23 +59,44 @@ export class Album extends Thing {
       }),
     ],
 
-    artistContribs: contributionList(),
-    coverArtistContribs: contributionList(),
-    trackCoverArtistContribs: contributionList(),
-    wallpaperArtistContribs: contributionList(),
-    bannerArtistContribs: contributionList(),
+    coverArtFileExtension: [
+      exitWithoutContribs({contribs: 'coverArtistContribs'}),
+      fileExtension('jpg'),
+    ],
 
-    groups: referenceList({
-      class: Group,
-      find: find.group,
-      data: 'groupData',
-    }),
+    trackCoverArtFileExtension: fileExtension('jpg'),
 
-    artTags: referenceList({
-      class: ArtTag,
-      find: find.artTag,
-      data: 'artTagData',
-    }),
+    wallpaperFileExtension: [
+      exitWithoutContribs({contribs: 'wallpaperArtistContribs'}),
+      fileExtension('jpg'),
+    ],
+
+    bannerFileExtension: [
+      exitWithoutContribs({contribs: 'bannerArtistContribs'}),
+      fileExtension('jpg'),
+    ],
+
+    wallpaperStyle: [
+      exitWithoutContribs({contribs: 'wallpaperArtistContribs'}),
+      simpleString(),
+    ],
+
+    bannerStyle: [
+      exitWithoutContribs({contribs: 'bannerArtistContribs'}),
+      simpleString(),
+    ],
+
+    bannerDimensions: [
+      exitWithoutContribs({contribs: 'bannerArtistContribs'}),
+      dimensions(),
+    ],
+
+    hasTrackNumbers: flag(true),
+    isListedOnHomepage: flag(true),
+    isListedInGalleries: flag(true),
+
+    commentary: commentary(),
+    additionalFiles: additionalFiles(),
 
     trackSections: [
       exitWithoutDependency({dependency: 'trackData', value: []}),
@@ -149,26 +170,23 @@ export class Album extends Thing {
       },
     ],
 
-    coverArtFileExtension: [
-      exitWithoutContribs({contribs: 'coverArtistContribs'}),
-      fileExtension('jpg'),
-    ],
-
-    trackCoverArtFileExtension: fileExtension('jpg'),
-
-    wallpaperStyle: simpleString(),
-    wallpaperFileExtension: fileExtension('jpg'),
-
-    bannerStyle: simpleString(),
-    bannerFileExtension: fileExtension('jpg'),
-    bannerDimensions: dimensions(),
+    artistContribs: contributionList(),
+    coverArtistContribs: contributionList(),
+    trackCoverArtistContribs: contributionList(),
+    wallpaperArtistContribs: contributionList(),
+    bannerArtistContribs: contributionList(),
 
-    hasTrackNumbers: flag(true),
-    isListedOnHomepage: flag(true),
-    isListedInGalleries: flag(true),
+    groups: referenceList({
+      class: Group,
+      find: find.group,
+      data: 'groupData',
+    }),
 
-    commentary: commentary(),
-    additionalFiles: additionalFiles(),
+    artTags: referenceList({
+      class: ArtTag,
+      find: find.artTag,
+      data: 'artTagData',
+    }),
 
     // Update only