replace OverloadedLabels with OverloadedRecordDot

This commit is contained in:
rhiannon morris 2024-07-11 22:00:00 +02:00
parent cd5801dd7d
commit 28520eb443
8 changed files with 126 additions and 138 deletions

View file

@ -3,7 +3,6 @@ module RSS (make, make') where
import Date
import Info
import BuilderQQ
import Records ()
import Data.List (sortBy)
import Data.Maybe (isJust)
@ -38,10 +37,10 @@ make' root ginfo@(GalleryInfo {title, desc, prefix}) output infos = [b|@0
|]
where
link = [b|$root/$prefix|]
nsfw = #nsfw ginfo
nsfw = ginfo.nsfw
items = map (uncurry $ makeItem root prefix nsfw) $
sortBy (flip (compareFor nsfw `on` #second)) $
filter (not . #unlisted . snd) infos
sortBy (flip (compareFor nsfw `on` snd)) $
filter (not . (.unlisted) . snd) infos
selflink = case output of
Nothing -> ""
Just o -> [b|<atom:link href="$link/$o" rel="self" />|]
@ -57,7 +56,7 @@ makeItem root prefix nsfw path i@(Info {title, artist}) = [b|@4
</item>
|]
where
up = if #updated i nsfw then [b| (updated)|] else ""
up = if hasUpdatesFor nsfw i then [b| (updated)|] else ""
dir = takeDirectory path
link = [b|$root/$prefix/$dir|]
artist' = ifJust artist \case
@ -65,7 +64,7 @@ makeItem root prefix nsfw path i@(Info {title, artist}) = [b|@4
Artist {name, url = Just url} -> [b|<p>by <a href=$url>$name</a>|]
desc = descFor nsfw i
desc' = makeDesc desc
descArtist' = if #exists desc || isJust artist then [b|@6
descArtist' = if desc.exists || isJust artist then [b|@6
<description>
<![CDATA[
$10.artist'
@ -74,7 +73,7 @@ makeItem root prefix nsfw path i@(Info {title, artist}) = [b|@4
</description>
|]
else ""
date = formatRSS $ #latestDate i nsfw
date = formatRSS $ latestDateFor nsfw i
makeDesc :: Desc -> Builder
makeDesc NoDesc = ""