fix latest date calculation

This commit is contained in:
rhiannon morris 2024-10-21 14:36:55 +02:00
parent 8e5d30d372
commit 5944a55020

View file

@ -199,7 +199,7 @@ thumb (Info {thumb', images}) =
latestDateFor :: Bool -> Info -> Date latestDateFor :: Bool -> Info -> Date
latestDateFor nsfw i = maximum $ i.date : mapMaybe relDate (updatesFor nsfw i) latestDateFor nsfw i = maximum $ i.date : mapMaybe relDate (updatesFor nsfw i)
where where
relDate (date, us) = date <$ guard (not $ null us || any (.ignoreSort) us) relDate (date, us) = date <$ guard (not $ null us || all (.ignoreSort) us)
latestYearFor :: Bool -> Info -> Int latestYearFor :: Bool -> Info -> Int
latestYearFor nsfw info = (latestDateFor nsfw info).year latestYearFor nsfw info = (latestDateFor nsfw info).year