aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Resource.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Resource.hs')
-rw-r--r--compiler/src/Resource.hs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs
index 207239f..53d61ac 100644
--- a/compiler/src/Resource.hs
+++ b/compiler/src/Resource.hs
@@ -31,7 +31,6 @@ import Data.Maybe (mapMaybe, fromMaybe)
31import Data.Function ((&)) 31import Data.Function ((&))
32import qualified Data.Set as Set 32import qualified Data.Set as Set
33import Data.Time.LocalTime (ZonedTime, utc, utcToZonedTime, zonedTimeToUTC) 33import Data.Time.LocalTime (ZonedTime, utc, utcToZonedTime, zonedTimeToUTC)
34import Data.Time.Format.ISO8601 (iso8601ParseM)
35import System.Directory (getModificationTime) 34import System.Directory (getModificationTime)
36import Safe.Foldable (maximumByMay) 35import Safe.Foldable (maximumByMay)
37 36
@@ -110,7 +109,7 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in
110 fileModTime <- lastModTime path 109 fileModTime <- lastModTime path
111 return GalleryItem 110 return GalleryItem
112 { title = itemTitle 111 { title = itemTitle
113 , date = fromMaybe fileModTime itemDate 112 , date = fromMaybe fileModTime $ Input.date sidecar
114 , description = optMeta description "" 113 , description = optMeta description ""
115 , tags = (optMeta tags []) ++ implicitParentTags parents 114 , tags = (optMeta tags []) ++ implicitParentTags parents
116 , path = parents </ itemTitle 115 , path = parents </ itemTitle
@@ -120,9 +119,6 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in
120 itemTitle :: String 119 itemTitle :: String
121 itemTitle = optMeta title $ fromMaybe "" $ fileName path 120 itemTitle = optMeta title $ fromMaybe "" $ fileName path
122 121
123 itemDate :: Maybe ZonedTime
124 itemDate = Input.date sidecar >>= iso8601ParseM
125
126 optMeta :: (Sidecar -> Maybe a) -> a -> a 122 optMeta :: (Sidecar -> Maybe a) -> a -> a
127 optMeta get fallback = fromMaybe fallback $ get sidecar 123 optMeta get fallback = fromMaybe fallback $ get sidecar
128 124