make #thumb smarter

This commit is contained in:
Rhiannon Morris 2020-07-15 20:07:51 +02:00
parent 849d893b86
commit d360121efd
2 changed files with 15 additions and 10 deletions

View file

@ -26,10 +26,7 @@ dependSingle' yaml info build nsfw =
thumbnail :: Info -> FilePath
thumbnail (Info {thumb = Just t}) = t
thumbnail (Info {images})
| Just i <- find #sfw images = #path i
| otherwise = error "no thumbnail or sfw images"
thumbnail = fromMaybe (error "no thumbnail or sfw images") . #thumb
addSuffix :: String -> FilePath -> FilePath
addSuffix suf path =