From 987eb81cb5d98262299c7917d752c54907cbbc33 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 23 Jan 2020 22:36:21 +0100 Subject: compiler: add directory incl and excl glob settings GitHub: closes #41 --- compiler/src/Config.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'compiler/src/Config.hs') diff --git a/compiler/src/Config.hs b/compiler/src/Config.hs index 53333a5..d670aae 100644 --- a/compiler/src/Config.hs +++ b/compiler/src/Config.hs @@ -34,8 +34,10 @@ import Resource (Resolution(..)) data CompilerConfig = CompilerConfig { galleryName :: String - , includeFiles :: [String] - , excludeFiles :: [String] + , includedDirectories :: [String] + , excludedDirectories :: [String] + , includedFiles :: [String] + , excludedFiles :: [String] , tagsFromDirectories :: Int , thumbnailMaxResolution :: Resolution , pictureMaxResolution :: Maybe Resolution @@ -44,8 +46,10 @@ data CompilerConfig = CompilerConfig instance FromJSON CompilerConfig where parseJSON = withObject "CompilerConfig" $ \v -> CompilerConfig <$> v .:? "galleryName" .!= "Gallery" - <*> v .:? "includeFiles" .!= ["*"] - <*> v .:? "excludeFiles" .!= [] + <*> v .:? "includedDirectories" .!= ["*"] + <*> v .:? "excludedDirectories" .!= [] + <*> v .:? "includedFiles" .!= ["*"] + <*> v .:? "excludedFiles" .!= [] <*> v .:? "tagsFromDirectories" .!= 0 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 400) <*> v .:? "pictureMaxResolution" -- cgit v1.2.3