diff options
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 |
commit | 380178e2001d03b6b2c4e330e5a101e519ad1136 (patch) | |
tree | c44505b8aaf614f17746d61557e801f84268b2d5 /src/data/composite/things | |
parent | 205aaac86e3b65e29f464cd4caf5d59c71bad14f (diff) |
data: Artwork.contentWarningArtTags, Artwork.contentWarnings
Diffstat (limited to 'src/data/composite/things')
-rw-r--r-- | src/data/composite/things/artwork/index.js | 1 | ||||
-rw-r--r-- | src/data/composite/things/artwork/withContentWarningArtTags.js | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/data/composite/things/artwork/index.js b/src/data/composite/things/artwork/index.js index e7cea070..b5e5e167 100644 --- a/src/data/composite/things/artwork/index.js +++ b/src/data/composite/things/artwork/index.js @@ -1,6 +1,7 @@ export {default as withArtTags} from './withArtTags.js'; export {default as withAttachedArtwork} from './withAttachedArtwork.js'; export {default as withContainingArtworkList} from './withContainingArtworkList.js'; +export {default as withContentWarningArtTags} from './withContentWarningArtTags.js'; export {default as withContribsFromAttachedArtwork} from './withContribsFromAttachedArtwork.js'; export {default as withDate} from './withDate.js'; export {default as withPropertyFromAttachedArtwork} from './withPropertyFromAttachedArtwork.js'; diff --git a/src/data/composite/things/artwork/withContentWarningArtTags.js b/src/data/composite/things/artwork/withContentWarningArtTags.js new file mode 100644 index 00000000..4c07e837 --- /dev/null +++ b/src/data/composite/things/artwork/withContentWarningArtTags.js @@ -0,0 +1,27 @@ +import {input, templateCompositeFrom} from '#composite'; + +import {withFilteredList, withPropertyFromList} from '#composite/data'; + +import withArtTags from './withArtTags.js'; + +export default templateCompositeFrom({ + annotation: `withContentWarningArtTags`, + + outputs: ['#contentWarningArtTags'], + + steps: () => [ + withArtTags(), + + withPropertyFromList({ + list: '#artTags', + property: input.value('isContentWarning'), + }), + + withFilteredList({ + list: '#artTags', + filter: '#artTags.isContentWarning', + }).outputs({ + '#filteredList': '#contentWarningArtTags', + }), + ], +}); |