From 685cbad73cab59210f7f8842e4399d0550f03905 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 13 May 2024 09:18:15 -0300 Subject: search, client: custom display for results w/ artwork warnings --- src/util/search-spec.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/search-spec.js b/src/util/search-spec.js index 6c6ad221..e9e0a6f9 100644 --- a/src/util/search-spec.js +++ b/src/util/search-spec.js @@ -39,6 +39,9 @@ function prepareArtwork(thing, { getThumbnailEqualOrSmaller, urls, }) { + const hasWarnings = + thing.artTags?.some(artTag => artTag.isContentWarning); + const artworkPath = getArtworkPath(thing); @@ -56,7 +59,9 @@ function prepareArtwork(thing, { } const selectedSize = - getThumbnailEqualOrSmaller('adorb', mediaSrc); + getThumbnailEqualOrSmaller( + (hasWarnings ? 'mini' : 'adorb'), + mediaSrc); const mediaSrcJpeg = mediaSrc.replace(/\.(png|jpg)$/, `.${selectedSize}.jpg`); -- cgit 1.3.0-6-gf8a5