diff options
author | pacien | 2020-01-23 22:36:21 +0100 |
---|---|---|
committer | Notkea | 2020-01-26 21:54:21 +0100 |
commit | 987eb81cb5d98262299c7917d752c54907cbbc33 (patch) | |
tree | 984c73e9a30676f33f05203cb96f57a6a7fda7e9 /compiler/src/Config.hs | |
parent | 8b83c3a77d4bf2ff01b3da789aba7197ff183f30 (diff) | |
download | ldgallery-987eb81cb5d98262299c7917d752c54907cbbc33.tar.gz |
compiler: add directory incl and excl glob settings
GitHub: closes #41
Diffstat (limited to 'compiler/src/Config.hs')
-rw-r--r-- | compiler/src/Config.hs | 12 |
1 files changed, 8 insertions, 4 deletions
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(..)) | |||
34 | 34 | ||
35 | data CompilerConfig = CompilerConfig | 35 | data CompilerConfig = CompilerConfig |
36 | { galleryName :: String | 36 | { galleryName :: String |
37 | , includeFiles :: [String] | 37 | , includedDirectories :: [String] |
38 | , excludeFiles :: [String] | 38 | , excludedDirectories :: [String] |
39 | , includedFiles :: [String] | ||
40 | , excludedFiles :: [String] | ||
39 | , tagsFromDirectories :: Int | 41 | , tagsFromDirectories :: Int |
40 | , thumbnailMaxResolution :: Resolution | 42 | , thumbnailMaxResolution :: Resolution |
41 | , pictureMaxResolution :: Maybe Resolution | 43 | , pictureMaxResolution :: Maybe Resolution |
@@ -44,8 +46,10 @@ data CompilerConfig = CompilerConfig | |||
44 | instance FromJSON CompilerConfig where | 46 | instance FromJSON CompilerConfig where |
45 | parseJSON = withObject "CompilerConfig" $ \v -> CompilerConfig | 47 | parseJSON = withObject "CompilerConfig" $ \v -> CompilerConfig |
46 | <$> v .:? "galleryName" .!= "Gallery" | 48 | <$> v .:? "galleryName" .!= "Gallery" |
47 | <*> v .:? "includeFiles" .!= ["*"] | 49 | <*> v .:? "includedDirectories" .!= ["*"] |
48 | <*> v .:? "excludeFiles" .!= [] | 50 | <*> v .:? "excludedDirectories" .!= [] |
51 | <*> v .:? "includedFiles" .!= ["*"] | ||
52 | <*> v .:? "excludedFiles" .!= [] | ||
49 | <*> v .:? "tagsFromDirectories" .!= 0 | 53 | <*> v .:? "tagsFromDirectories" .!= 0 |
50 | <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 400) | 54 | <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 400) |
51 | <*> v .:? "pictureMaxResolution" | 55 | <*> v .:? "pictureMaxResolution" |