X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FCacheLibrary.java;h=cccfedba0cfd29ec755034b9197f7a7495dd0b38;hp=e8743b63cd9d18ca0ef0ba3316aa204433b4bf34;hb=d66deb8d8b30cff6b54db352eef34a3508939f84;hpb=0013f760d69fd7db2b298c3da5d89bc0b102eabf diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index e8743b6..cccfedb 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -7,8 +7,10 @@ import java.util.List; import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.bundles.UiConfig; +import be.nikiroo.fanfix.bundles.UiConfigBundle; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; +import be.nikiroo.fanfix.output.BasicOutput.OutputType; import be.nikiroo.utils.Image; import be.nikiroo.utils.Progress; @@ -25,19 +27,18 @@ public class CacheLibrary extends BasicLibrary { /** * Create a cache library around the given one. *

- * It will return the same result, but those will be saved to disk at the - * same time to be fetched quicker the next time. + * It will return the same result, but those will be saved to disk at the same + * time to be fetched quicker the next time. * - * @param cacheDir - * the cache directory where to save the files to disk - * @param lib - * the original library to wrap + * @param cacheDir the cache directory where to save the files to disk + * @param lib the original library to wrap + * @param config the configuration used to know which kind of default + * {@link OutputType} to use for images and non-images stories */ - public CacheLibrary(File cacheDir, BasicLibrary lib) { - this.cacheLib = new LocalLibrary(cacheDir, Instance.getUiConfig() - .getString(UiConfig.GUI_NON_IMAGES_DOCUMENT_TYPE), Instance - .getUiConfig().getString(UiConfig.GUI_IMAGES_DOCUMENT_TYPE), - true); + public CacheLibrary(File cacheDir, BasicLibrary lib, UiConfigBundle config) { + this.cacheLib = new LocalLibrary(cacheDir, // + config.getString(UiConfig.GUI_NON_IMAGES_DOCUMENT_TYPE), + config.getString(UiConfig.GUI_IMAGES_DOCUMENT_TYPE), true); this.lib = lib; } @@ -95,7 +96,7 @@ public class CacheLibrary extends BasicLibrary { updateInfo(cacheLib.getInfo(luid)); pgImport.done(); } catch (IOException e) { - Instance.getTraceHandler().error(e); + Instance.getInstance().getTraceHandler().error(e); } pgImport.done();