aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Resource.hs
diff options
context:
space:
mode:
authorpacien2020-01-05 15:31:38 +0100
committerpacien2020-01-05 15:31:38 +0100
commitabdf82bbfde843a87bd00746f52dafdd28f3f60b (patch)
tree252c734cdbc2edc6d85c76a0f0d9422fb95fe4d9 /compiler/src/Resource.hs
parent5367781f0c7fd1ce274492ba91895fef9d44dab3 (diff)
downloadldgallery-abdf82bbfde843a87bd00746f52dafdd28f3f60b.tar.gz
compiler: make absent file names more explicit
Diffstat (limited to 'compiler/src/Resource.hs')
-rw-r--r--compiler/src/Resource.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs
index bbabf18..b52522c 100644
--- a/compiler/src/Resource.hs
+++ b/compiler/src/Resource.hs
@@ -1,7 +1,7 @@
1-- ldgallery - A static generator which turns a collection of tagged 1-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery. 2-- pictures into a searchable web gallery.
3-- 3--
4-- Copyright (C) 2019 Pacien TRAN-GIRARD 4-- Copyright (C) 2019-2020 Pacien TRAN-GIRARD
5-- 5--
6-- This program is free software: you can redistribute it and/or modify 6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as 7-- it under the terms of the GNU Affero General Public License as
@@ -118,7 +118,7 @@ buildGalleryTree processDir processItem processThumbnail addDirTag galleryName i
118 (processedItemPath, properties) <- processItem path 118 (processedItemPath, properties) <- processItem path
119 processedThumbnail <- processThumbnail path 119 processedThumbnail <- processThumbnail path
120 return GalleryItem 120 return GalleryItem
121 { title = optMeta title $ fileName path 121 { title = optMeta title $ fromMaybe "" $ fileName path
122 , date = optMeta date "" -- TODO: check and normalise dates 122 , date = optMeta date "" -- TODO: check and normalise dates
123 , description = optMeta description "" 123 , description = optMeta description ""
124 , tags = (optMeta tags []) ++ implicitParentTag parent 124 , tags = (optMeta tags []) ++ implicitParentTag parent
@@ -133,9 +133,9 @@ buildGalleryTree processDir processItem processThumbnail addDirTag galleryName i
133 do 133 do
134 processedDir <- processDir path 134 processedDir <- processDir path
135 processedThumbnail <- maybeThumbnail dirThumbnailPath 135 processedThumbnail <- maybeThumbnail dirThumbnailPath
136 processedItems <- parallel $ map (mkGalleryItem $ maybeFileName path) items 136 processedItems <- parallel $ map (mkGalleryItem $ fileName path) items
137 return GalleryItem 137 return GalleryItem
138 { title = fileName path 138 { title = fromMaybe "" $ fileName path
139 -- TODO: consider using the most recent item's date? what if empty? 139 -- TODO: consider using the most recent item's date? what if empty?
140 , date = "" 140 , date = ""
141 -- TODO: consider allowing metadata sidecars for directories too 141 -- TODO: consider allowing metadata sidecars for directories too
@@ -177,7 +177,7 @@ galleryOutputDiff resources ref =
177 thumbnailPaths = (concatMap subPaths) . (mapMaybe thumbnail) 177 thumbnailPaths = (concatMap subPaths) . (mapMaybe thumbnail)
178 178
179 fsPaths :: FSNode -> [Path] 179 fsPaths :: FSNode -> [Path]
180 fsPaths = map nodePath . tail . flattenDir 180 fsPaths = map Files.path . tail . flattenDir
181 181
182 182
183galleryCleanupResourceDir :: GalleryItem -> FileName -> IO () 183galleryCleanupResourceDir :: GalleryItem -> FileName -> IO ()