From e06632eecd6d4b194c3dbe6322097ee61457ec33 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sun, 26 Nov 2017 16:37:08 +0100 Subject: [PATCH] Fix source (type)) lost on redownload: again --- src/be/nikiroo/fanfix/library/CacheLibrary.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index 38fb7b31..d653332a 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -153,7 +153,9 @@ public class CacheLibrary extends BasicLibrary { pg.addProgress(pgCache, 1); pg.addProgress(pgOrig, 1); - cacheLib.changeSource(luid, newSource, pgCache); + if (isCached(luid)) { + cacheLib.changeSource(luid, newSource, pgCache); + } pgCache.done(); lib.changeSource(luid, newSource, pgOrig); pgOrig.done(); @@ -184,8 +186,10 @@ public class CacheLibrary extends BasicLibrary { * in case of I/O error */ public void clearFromCache(String luid) throws IOException { - cacheLib.delete(luid); - clearCache(); + if (isCached(luid)) { + cacheLib.delete(luid); + clearCache(); + } } // All the following methods are only used by Save and Delete in -- 2.27.0