diff options
Diffstat (limited to 'compiler/src/Compiler.hs')
-rw-r--r-- | compiler/src/Compiler.hs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler/src/Compiler.hs b/compiler/src/Compiler.hs index 0a3e540..048afc1 100644 --- a/compiler/src/Compiler.hs +++ b/compiler/src/Compiler.hs | |||
@@ -37,8 +37,7 @@ import qualified Data.Aeson as JSON | |||
37 | 37 | ||
38 | import Config | 38 | import Config |
39 | import Input (decodeYamlFile, readInputTree) | 39 | import Input (decodeYamlFile, readInputTree) |
40 | import Resource (ResourceTree, buildResourceTree, cleanupResourceDir) | 40 | import Resource (GalleryItem, buildGalleryTree, galleryCleanupResourceDir) |
41 | import Gallery (buildGallery) | ||
42 | import Files | 41 | import Files |
43 | ( FileName | 42 | ( FileName |
44 | , FSNode(..) | 43 | , FSNode(..) |
@@ -75,17 +74,15 @@ compileGallery inputDirPath outputDirPath rebuildAll = | |||
75 | 74 | ||
76 | invalidateCache <- isOutdated False inputGalleryConf outputIndex | 75 | invalidateCache <- isOutdated False inputGalleryConf outputIndex |
77 | let cache = if invalidateCache || rebuildAll then skipCached else withCached | 76 | let cache = if invalidateCache || rebuildAll then skipCached else withCached |
77 | |||
78 | let itemProc = itemProcessor (pictureMaxResolution config) cache | 78 | let itemProc = itemProcessor (pictureMaxResolution config) cache |
79 | let thumbnailProc = thumbnailProcessor (thumbnailResolution config) cache | 79 | let thumbnailProc = thumbnailProcessor (thumbnailResolution config) cache |
80 | resourceTree <- buildResourceTree dirProcessor itemProc thumbnailProc inputTree | 80 | let galleryBuilder = buildGalleryTree dirProcessor itemProc thumbnailProc |
81 | 81 | resources <- galleryBuilder (galleryName config) inputTree | |
82 | cleanupResourceDir resourceTree outputDirPath | ||
83 | |||
84 | buildGallery (galleryName config) resourceTree | ||
85 | & writeJSON outputIndex | ||
86 | 82 | ||
87 | viewer fullConfig | 83 | galleryCleanupResourceDir resources outputDirPath |
88 | & writeJSON outputViewerConf | 84 | writeJSON outputIndex resources |
85 | writeJSON outputViewerConf $ viewer fullConfig | ||
89 | 86 | ||
90 | where | 87 | where |
91 | galleryConf = "gallery.yaml" | 88 | galleryConf = "gallery.yaml" |