From e27f9a220fd8597266d52934bcb06dbe1681b338 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 16 Jun 2020 23:30:32 +0200 Subject: compiler: allow setting thumbnails for all items Not only for directories. GitHub: closes #224 --- compiler/src/Resource.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/src/Resource.hs') diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs index 6b4b44c..f59eed6 100644 --- a/compiler/src/Resource.hs +++ b/compiler/src/Resource.hs @@ -134,11 +134,11 @@ buildGalleryTree processItem processThumbnail tagsFromDirsConfig = mkGalleryItem [] where mkGalleryItem :: [Tag] -> InputTree -> IO GalleryItem - mkGalleryItem inheritedTags InputFile{path, modTime, sidecar} = + mkGalleryItem inheritedTags InputFile{path, modTime, sidecar, thumbnailPath} = do let itemPath = "/" /> path properties <- processItem itemPath path - processedThumbnail <- processThumbnail itemPath path + processedThumbnail <- processThumbnail itemPath (thumbnailPath ?? path) return GalleryItem { title = Input.title sidecar ?? fileName path ?? "" , datetime = Input.datetime sidecar ?? toZonedTime modTime @@ -148,12 +148,12 @@ buildGalleryTree processItem processThumbnail tagsFromDirsConfig = , thumbnail = processedThumbnail , properties = properties } - mkGalleryItem inheritedTags InputDir{path, modTime, sidecar, dirThumbnailPath, items} = + mkGalleryItem inheritedTags InputDir{path, modTime, sidecar, thumbnailPath, items} = do let itemPath = "/" /> path let dirTags = (Input.tags sidecar ?? []) ++ inheritedTags processedItems <- parallel $ map (mkGalleryItem dirTags) items - processedThumbnail <- maybeThumbnail itemPath dirThumbnailPath + processedThumbnail <- maybeThumbnail itemPath thumbnailPath return GalleryItem { title = Input.title sidecar ?? fileName path ?? "" , datetime = Input.datetime sidecar ?? mostRecentModTime processedItems -- cgit v1.2.3