From: Niki Roo Date: Sun, 26 Nov 2017 15:37:08 +0000 (+0100) Subject: Fix source (type)) lost on redownload: again X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=e06632eecd6d4b194c3dbe6322097ee61457ec33;p=nikiroo-utils.git Fix source (type)) lost on redownload: again --- diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index 38fb7b3..d653332 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