From bde75df8ca81e06a12a949516a71c8a73c7be18e Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Tue, 9 Jan 2024 15:35:31 +0100 Subject: [PATCH] fix sfw sort with nsfw update if the last update to an item is nsfw-only, then it would affect the sfw sorting, even tho it is not relevant, and even if it had ignore-sort set. now it works properly in that situation --- make-pages/Info.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make-pages/Info.hs b/make-pages/Info.hs index 10d6632..0677ca0 100644 --- a/make-pages/Info.hs +++ b/make-pages/Info.hs @@ -163,7 +163,8 @@ instance HasField "notMine" Info Bool where getField = isJust . #artist instance HasField "latestDate" Info (Bool -> Date) where getField info@(Info {date=date₀}) nsfw = maximum $ date₀ : mapMaybe relDate (updatesFor nsfw info) - where relDate (date, us) = date <$ guard (not $ any #ignoreSort us) + where + relDate (date, us) = date <$ guard (not $ null us || any #ignoreSort us) instance HasField "latestYear" Info (Bool -> Int) where getField info nsfw = #year $ #latestDate info nsfw