From abdf82bbfde843a87bd00746f52dafdd28f3f60b Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 5 Jan 2020 15:31:38 +0100 Subject: compiler: make absent file names more explicit --- compiler/src/Resource.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/src/Resource.hs') 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 @@ -- ldgallery - A static generator which turns a collection of tagged -- pictures into a searchable web gallery. -- --- Copyright (C) 2019 Pacien TRAN-GIRARD +-- Copyright (C) 2019-2020 Pacien TRAN-GIRARD -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as @@ -118,7 +118,7 @@ buildGalleryTree processDir processItem processThumbnail addDirTag galleryName i (processedItemPath, properties) <- processItem path processedThumbnail <- processThumbnail path return GalleryItem - { title = optMeta title $ fileName path + { title = optMeta title $ fromMaybe "" $ fileName path , date = optMeta date "" -- TODO: check and normalise dates , description = optMeta description "" , tags = (optMeta tags []) ++ implicitParentTag parent @@ -133,9 +133,9 @@ buildGalleryTree processDir processItem processThumbnail addDirTag galleryName i do processedDir <- processDir path processedThumbnail <- maybeThumbnail dirThumbnailPath - processedItems <- parallel $ map (mkGalleryItem $ maybeFileName path) items + processedItems <- parallel $ map (mkGalleryItem $ fileName path) items return GalleryItem - { title = fileName path + { title = fromMaybe "" $ fileName path -- TODO: consider using the most recent item's date? what if empty? , date = "" -- TODO: consider allowing metadata sidecars for directories too @@ -177,7 +177,7 @@ galleryOutputDiff resources ref = thumbnailPaths = (concatMap subPaths) . (mapMaybe thumbnail) fsPaths :: FSNode -> [Path] - fsPaths = map nodePath . tail . flattenDir + fsPaths = map Files.path . tail . flattenDir galleryCleanupResourceDir :: GalleryItem -> FileName -> IO () -- cgit v1.2.3