From f1ffff03ad6bf86c32c3af90393bd53ca21ad4db Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 6 Jan 2020 11:05:18 +0100 Subject: compiler: rename date field to more explicit datetime --- compiler/src/Input.hs | 4 ++-- compiler/src/Resource.hs | 12 ++++++------ example/Glacier 3000/_DSC5475.jpg.yaml | 2 +- example/Glacier 3000/_DSC5542.jpg.yaml | 2 +- example/_DSC8808-1.jpg.yaml | 2 +- ldgallery.1.md | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs index 85c802e..95d8132 100644 --- a/compiler/src/Input.hs +++ b/compiler/src/Input.hs @@ -61,7 +61,7 @@ data InputTree = data Sidecar = Sidecar { title :: Maybe String - , date :: Maybe ZonedTime + , datetime :: Maybe ZonedTime , description :: Maybe String , tags :: Maybe [String] } deriving (Generic, FromJSON, Show) @@ -69,7 +69,7 @@ data Sidecar = Sidecar emptySidecar :: Sidecar emptySidecar = Sidecar { title = Nothing - , date = Nothing + , datetime = Nothing , description = Nothing , tags = Nothing } diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs index 53d61ac..29906b7 100644 --- a/compiler/src/Resource.hs +++ b/compiler/src/Resource.hs @@ -78,7 +78,7 @@ instance ToJSON GalleryItemProps where data GalleryItem = GalleryItem { title :: String - , date :: ZonedTime + , datetime :: ZonedTime , description :: String , tags :: [Tag] , path :: Path @@ -109,7 +109,7 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in fileModTime <- lastModTime path return GalleryItem { title = itemTitle - , date = fromMaybe fileModTime $ Input.date sidecar + , datetime = fromMaybe fileModTime $ Input.datetime sidecar , description = optMeta description "" , tags = (optMeta tags []) ++ implicitParentTags parents , path = parents Maybe ZonedTime mostRecentChildModTime = - maximumByMay comparingDates . map (date::(GalleryItem -> ZonedTime)) + maximumByMay comparingTime . map (datetime::(GalleryItem -> ZonedTime)) - comparingDates :: ZonedTime -> ZonedTime -> Ordering - comparingDates l r = compare (zonedTimeToUTC l) (zonedTimeToUTC r) + comparingTime :: ZonedTime -> ZonedTime -> Ordering + comparingTime l r = compare (zonedTimeToUTC l) (zonedTimeToUTC r) aggregateChildTags :: [GalleryItem] -> [Tag] aggregateChildTags = unique . concatMap (\item -> tags (item::GalleryItem)) diff --git a/example/Glacier 3000/_DSC5475.jpg.yaml b/example/Glacier 3000/_DSC5475.jpg.yaml index d60efc3..3454a68 100644 --- a/example/Glacier 3000/_DSC5475.jpg.yaml +++ b/example/Glacier 3000/_DSC5475.jpg.yaml @@ -1,6 +1,6 @@ title: Fog 3000 -date: 2019-08-10T14:38:47+01:00 +datetime: 2019-08-10T14:38:47+01:00 description: > © Philippe NGUYEN diff --git a/example/Glacier 3000/_DSC5542.jpg.yaml b/example/Glacier 3000/_DSC5542.jpg.yaml index a67b284..d174911 100644 --- a/example/Glacier 3000/_DSC5542.jpg.yaml +++ b/example/Glacier 3000/_DSC5542.jpg.yaml @@ -1,6 +1,6 @@ title: Foggy catwalk -date: 2019-08-10T16:00:45+01:00 +datetime: 2019-08-10T16:00:45+01:00 description: > © Philippe NGUYEN diff --git a/example/_DSC8808-1.jpg.yaml b/example/_DSC8808-1.jpg.yaml index ce334c2..b946ff7 100644 --- a/example/_DSC8808-1.jpg.yaml +++ b/example/_DSC8808-1.jpg.yaml @@ -1,6 +1,6 @@ title: Book shop -date: 2016-12-19T16:48:50+02:00 +datetime: 2016-12-19T16:48:50+02:00 description: > © Philippe NGUYEN diff --git a/ldgallery.1.md b/ldgallery.1.md index 7163c8e..d217367 100644 --- a/ldgallery.1.md +++ b/ldgallery.1.md @@ -73,7 +73,7 @@ Metadata contained within item files themselves (e.g. Exif fields for pictures) title : Title of the item. Defaults to the name of the file. -date +datetime : ISO 8601 zoned date and time. Defaults to the last modification time of the file. description -- cgit v1.2.3