X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FCacheLibrary.java;h=a550740bafa7a9105d271ef9dd7df53515651d6e;hb=cf45a4c44b472d0e1bbbcbc9891020366e99364c;hp=29920e8902b0090354ae7d82680fe7d4bdf866d3;hpb=e1de8087ab1623f7624018af905ea3bb0ef45802;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index 29920e8..a550740 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -117,7 +117,12 @@ public class CacheLibrary extends BasicLibrary { return custom; } - return cacheLib.getSourceCover(source); + Image cached = cacheLib.getSourceCover(source); + if (cached != null) { + return cached; + } + + return lib.getSourceCover(source); } @Override @@ -136,7 +141,7 @@ public class CacheLibrary extends BasicLibrary { @Override public void setSourceCover(String source, String luid) { lib.setSourceCover(source, luid); - cacheLib.setSourceCover(source, getSourceCover(source)); + cacheLib.setSourceCover(source, getCover(luid)); } @Override @@ -249,6 +254,9 @@ public class CacheLibrary extends BasicLibrary { /** * Clear the {@link Story} from the cache. + *

+ * The next time we try to retrieve the {@link Story}, it may be required to + * cache it again. * * @param luid * the story to clear