aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Config.hs
diff options
context:
space:
mode:
authorpacien2020-01-05 20:40:41 +0100
committerpacien2020-01-05 20:40:41 +0100
commit1e3a0e39cb6cdc86a6ba6b570c72c44931cf1c3b (patch)
tree2746d5fe93eb00162b146a054761a2c8e7f76ed2 /compiler/src/Config.hs
parent2ad60869c2e8d0846672ccb18b2de99c9cf33671 (diff)
downloadldgallery-1e3a0e39cb6cdc86a6ba6b570c72c44931cf1c3b.tar.gz
compiler: replace file filter with inclusino and exclusion glob lists
GitHub: closes #16
Diffstat (limited to 'compiler/src/Config.hs')
-rw-r--r--compiler/src/Config.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/Config.hs b/compiler/src/Config.hs
index 20bc3bb..53333a5 100644
--- a/compiler/src/Config.hs
+++ b/compiler/src/Config.hs
@@ -34,7 +34,8 @@ import Resource (Resolution(..))
34 34
35data CompilerConfig = CompilerConfig 35data CompilerConfig = CompilerConfig
36 { galleryName :: String 36 { galleryName :: String
37 , ignoreFiles :: String 37 , includeFiles :: [String]
38 , excludeFiles :: [String]
38 , tagsFromDirectories :: Int 39 , tagsFromDirectories :: Int
39 , thumbnailMaxResolution :: Resolution 40 , thumbnailMaxResolution :: Resolution
40 , pictureMaxResolution :: Maybe Resolution 41 , pictureMaxResolution :: Maybe Resolution
@@ -43,7 +44,8 @@ data CompilerConfig = CompilerConfig
43instance FromJSON CompilerConfig where 44instance FromJSON CompilerConfig where
44 parseJSON = withObject "CompilerConfig" $ \v -> CompilerConfig 45 parseJSON = withObject "CompilerConfig" $ \v -> CompilerConfig
45 <$> v .:? "galleryName" .!= "Gallery" 46 <$> v .:? "galleryName" .!= "Gallery"
46 <*> v .:? "ignoreFiles" .!= ".^" 47 <*> v .:? "includeFiles" .!= ["*"]
48 <*> v .:? "excludeFiles" .!= []
47 <*> v .:? "tagsFromDirectories" .!= 0 49 <*> v .:? "tagsFromDirectories" .!= 0
48 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 400) 50 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 400)
49 <*> v .:? "pictureMaxResolution" 51 <*> v .:? "pictureMaxResolution"