aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Config.hs
diff options
context:
space:
mode:
authorOzoneGrif2020-04-04 02:36:03 +0200
committerGitHub2020-04-04 02:36:03 +0200
commitc26ab69997d1d552fda72b8fd88d5910fc91b779 (patch)
treeaea8a7801c1445e71d966ca3a0532200abf2c724 /compiler/src/Config.hs
parent332b208d3fdc91d29181c8f42ef5ff9b1fd1f09a (diff)
parent84090e0f534cfa8bf601ae6df21e5df695fd149a (diff)
downloadldgallery-c26ab69997d1d552fda72b8fd88d5910fc91b779.tar.gz
Merge pull request #172 from pacien/tag-categories
Feature: tag categories
Diffstat (limited to 'compiler/src/Config.hs')
-rw-r--r--compiler/src/Config.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/src/Config.hs b/compiler/src/Config.hs
index 8796c3c..0ae0fa1 100644
--- a/compiler/src/Config.hs
+++ b/compiler/src/Config.hs
@@ -57,6 +57,7 @@ data GalleryConfig = GalleryConfig
57 , excludedFiles :: [String] 57 , excludedFiles :: [String]
58 , includedTags :: [String] 58 , includedTags :: [String]
59 , excludedTags :: [String] 59 , excludedTags :: [String]
60 , tagCategories :: [String]
60 , tagsFromDirectories :: TagsFromDirectoriesConfig 61 , tagsFromDirectories :: TagsFromDirectoriesConfig
61 , thumbnailMaxResolution :: Resolution 62 , thumbnailMaxResolution :: Resolution
62 , pictureMaxResolution :: Maybe Resolution 63 , pictureMaxResolution :: Maybe Resolution
@@ -71,6 +72,7 @@ instance FromJSON GalleryConfig where
71 <*> v .:? "excludedFiles" .!= [] 72 <*> v .:? "excludedFiles" .!= []
72 <*> v .:? "includedTags" .!= ["*"] 73 <*> v .:? "includedTags" .!= ["*"]
73 <*> v .:? "excludedTags" .!= [] 74 <*> v .:? "excludedTags" .!= []
75 <*> v .:? "tagCategories" .!= []
74 <*> v .:? "tagsFromDirectories" .!= (TagsFromDirectoriesConfig 0 "") 76 <*> v .:? "tagsFromDirectories" .!= (TagsFromDirectoriesConfig 0 "")
75 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 300) 77 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 300)
76 <*> v .:? "pictureMaxResolution" 78 <*> v .:? "pictureMaxResolution"
@@ -80,9 +82,9 @@ readConfig = decodeYamlFile
80 82
81 83
82data ViewerConfig = ViewerConfig 84data ViewerConfig = ViewerConfig
83 { -- TODO: add viewer config keys (tag groups...) 85 { galleryTitle :: String
84 galleryTitle :: String 86 , tagCategories :: [String]
85 } deriving (Generic, ToJSON, Show) 87 } deriving (Generic, ToJSON, Show)
86 88
87viewerConfig :: GalleryConfig -> ViewerConfig 89viewerConfig :: GalleryConfig -> ViewerConfig
88viewerConfig GalleryConfig{galleryTitle} = ViewerConfig galleryTitle 90viewerConfig GalleryConfig{galleryTitle, tagCategories} = ViewerConfig galleryTitle tagCategories