diff options
author | pacien | 2020-06-13 03:41:39 +0200 |
---|---|---|
committer | pacien | 2020-06-16 18:23:01 +0200 |
commit | ce2210e6deff1d981186b6d7ddb1176f27e41f49 (patch) | |
tree | 63d83660e733f16ef18d48debbc97c091c492c1f /compiler/src/Compiler.hs | |
parent | 34b90f08a21fbe3f1928e16a8ea48f1fc7453e4e (diff) | |
download | ldgallery-ce2210e6deff1d981186b6d7ddb1176f27e41f49.tar.gz |
compiler: make GalleryIndex loadable from JSON
Diffstat (limited to 'compiler/src/Compiler.hs')
-rw-r--r-- | compiler/src/Compiler.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/Compiler.hs b/compiler/src/Compiler.hs index 2bb27f9..5a7632d 100644 --- a/compiler/src/Compiler.hs +++ b/compiler/src/Compiler.hs | |||
@@ -29,7 +29,7 @@ import System.FilePath ((</>)) | |||
29 | import qualified System.FilePath.Glob as Glob | 29 | import qualified System.FilePath.Glob as Glob |
30 | import System.Directory (canonicalizePath) | 30 | import System.Directory (canonicalizePath) |
31 | 31 | ||
32 | import Data.Aeson (ToJSON) | 32 | import Data.Aeson (ToJSON, FromJSON) |
33 | import qualified Data.Aeson as JSON | 33 | import qualified Data.Aeson as JSON |
34 | 34 | ||
35 | import Config | 35 | import Config |
@@ -64,7 +64,7 @@ thumbnailsDir = "thumbnails" | |||
64 | data GalleryIndex = GalleryIndex | 64 | data GalleryIndex = GalleryIndex |
65 | { properties :: ViewerConfig | 65 | { properties :: ViewerConfig |
66 | , tree :: GalleryItem | 66 | , tree :: GalleryItem |
67 | } deriving (Generic, Show, ToJSON) | 67 | } deriving (Generic, Show, ToJSON, FromJSON) |
68 | 68 | ||
69 | 69 | ||
70 | writeJSON :: ToJSON a => FileName -> a -> IO () | 70 | writeJSON :: ToJSON a => FileName -> a -> IO () |