Fix default remote lib not using cache
authorNiki Roo <niki@nikiroo.be>
Sat, 2 Dec 2017 20:49:21 +0000 (21:49 +0100)
committerNiki Roo <niki@nikiroo.be>
Sat, 2 Dec 2017 20:49:21 +0000 (21:49 +0100)
VERSION
src/be/nikiroo/fanfix/Instance.java
src/be/nikiroo/fanfix/Main.java

diff --git a/VERSION b/VERSION
index 266146b87cbc8e6d59fe83c426a8500f9549adfb..40488c222cfafb385a9b899db167ecd1c1a9692f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.6.3
+1.6.3-dev
index 7ed5e25940ad94954c4d8abe9a906667fc4900d7..4dde3fa642b8cfaae5265250e86606b494ec0328 100644 (file)
@@ -11,6 +11,7 @@ import be.nikiroo.fanfix.bundles.StringIdBundle;
 import be.nikiroo.fanfix.bundles.UiConfig;
 import be.nikiroo.fanfix.bundles.UiConfigBundle;
 import be.nikiroo.fanfix.library.BasicLibrary;
+import be.nikiroo.fanfix.library.CacheLibrary;
 import be.nikiroo.fanfix.library.LocalLibrary;
 import be.nikiroo.fanfix.library.RemoteLibrary;
 import be.nikiroo.utils.Cache;
@@ -126,10 +127,12 @@ public class Instance {
                                        String key = remoteLib.substring(0, pos).trim();
 
                                        try {
-                                               tracer.trace("Contacting remote library " + host + ":"
+                                               tracer.trace("Selecting remote library " + host + ":"
                                                                + port);
                                                lib = new RemoteLibrary(key, host,
                                                                Integer.parseInt(port));
+                                               lib = new CacheLibrary(getRemoteDir(host), lib);
+
                                        } catch (Exception e) {
                                        }
                                }
index 0da6bbab3dc7344e2df04f7e7bf6de6cdce5ead4..f413a2d66e95ce296d8d7d1388103b98c41e7722 100644 (file)
@@ -199,9 +199,8 @@ public class Main {
                                } else if (port == null) {
                                        port = Integer.parseInt(args[i]);
 
-                                       File remoteCacheDir = Instance.getRemoteDir(host);
                                        BasicLibrary lib = new RemoteLibrary(key, host, port);
-                                       lib = new CacheLibrary(remoteCacheDir, lib);
+                                       lib = new CacheLibrary(Instance.getRemoteDir(host), lib);
 
                                        BasicReader.setDefaultLibrary(lib);