From 5895a95876fe63e76e726ef7fc4c97efe2ebd5b1 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sat, 2 Dec 2017 21:49:21 +0100 Subject: [PATCH] Fix default remote lib not using cache --- VERSION | 2 +- src/be/nikiroo/fanfix/Instance.java | 5 ++++- src/be/nikiroo/fanfix/Main.java | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 266146b..40488c2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3 +1.6.3-dev diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 7ed5e25..4dde3fa 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -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) { } } diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index 0da6bba..f413a2d 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -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); -- 2.27.0