« get me outta code hell

data: Artwork.contentWarningArtTags, Artwork.contentWarnings - 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>2025-07-21 19:14:54 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-21 19:14:54 -0300
commit380178e2001d03b6b2c4e330e5a101e519ad1136 (patch)
treec44505b8aaf614f17746d61557e801f84268b2d5 /src/data/things
parent205aaac86e3b65e29f464cd4caf5d59c71bad14f (diff)
data: Artwork.contentWarningArtTags, Artwork.contentWarnings
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/artwork.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/data/things/artwork.js b/src/data/things/artwork.js
index b5d9cc66..c54bcced 100644
--- a/src/data/things/artwork.js
+++ b/src/data/things/artwork.js
@@ -25,7 +25,7 @@ import {
   parseDimensions,
 } from '#yaml';
 
-import {withPropertyFromObject} from '#composite/data';
+import {withPropertyFromList, withPropertyFromObject} from '#composite/data';
 
 import {
   exitWithoutDependency,
@@ -58,6 +58,7 @@ import {
   withArtTags,
   withAttachedArtwork,
   withContainingArtworkList,
+  withContentWarningArtTags,
   withContribsFromAttachedArtwork,
   withPropertyFromAttachedArtwork,
   withDate,
@@ -362,6 +363,27 @@ export class Artwork extends Thing {
         value: input.value([]),
       }),
     ],
+
+    contentWarningArtTags: [
+      withContentWarningArtTags(),
+
+      exposeDependency({
+        dependency: '#contentWarningArtTags',
+      }),
+    ],
+
+    contentWarnings: [
+      withContentWarningArtTags(),
+
+      withPropertyFromList({
+        list: '#contentWarningArtTags',
+        property: input.value('name'),
+      }),
+
+      exposeDependency({
+        dependency: '#contentWarningArtTags.name',
+      }),
+    ],
   });
 
   static [Thing.yamlDocumentSpec] = {