From 005ea7957a75e53b443bbc5a596909df457343b8 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 26 Oct 2020 12:43:49 +0100 Subject: compiler/Caching: fix cache thumbnail masking in index GitHub: closes #280 --- compiler/src/Caching.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/src/Caching.hs') diff --git a/compiler/src/Caching.hs b/compiler/src/Caching.hs index c2b5a43..1a8b710 100644 --- a/compiler/src/Caching.hs +++ b/compiler/src/Caching.hs @@ -53,7 +53,7 @@ buildItemCache cachedItems = lookupCache cachedMap = Map.fromList (map withKey cachedItemList) lookupCache path = Map.lookup (webPath path) cachedMap -useCached :: ItemCache -> (GalleryItem -> a) -> Cache a +useCached :: ItemCache -> (GalleryItem -> Maybe a) -> Cache a useCached cache propGetter processor itemPath resPath inputFsPath outputFsPath = do isDir <- doesDirectoryExist outputFsPath @@ -63,7 +63,7 @@ useCached cache propGetter processor itemPath resPath inputFsPath outputFsPath = if fileExists then do needUpdate <- isOutdated True inputFsPath outputFsPath - case (needUpdate, cache itemPath) of + case (needUpdate, cache itemPath >>= propGetter) of (False, Just props) -> fromCache props _ -> update else @@ -73,4 +73,4 @@ useCached cache propGetter processor itemPath resPath inputFsPath outputFsPath = update = processor itemPath resPath inputFsPath outputFsPath fromCache props = putStrLn ("From cache:\t" ++ outputFsPath) - >> return (propGetter props) + >> return props -- cgit v1.2.3