X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FCacheLibrary.java;h=29920e8902b0090354ae7d82680fe7d4bdf866d3;hp=977331f33ecf0783084f730414b0862dd1de86c1;hb=e1de8087ab1623f7624018af905ea3bb0ef45802;hpb=afb2acc77cae8001c2fe0bfd48ebf3d339eddb38 diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index 977331f..29920e8 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -112,8 +112,25 @@ public class CacheLibrary extends BasicLibrary { @Override public Image getSourceCover(String source) { - // no cache for the source cover - return lib.getSourceCover(source); + Image custom = getCustomSourceCover(source); + if (custom != null) { + return custom; + } + + return cacheLib.getSourceCover(source); + } + + @Override + public Image getCustomSourceCover(String source) { + Image custom = cacheLib.getCustomSourceCover(source); + if (custom == null) { + custom = lib.getCustomSourceCover(source); + if (custom != null) { + cacheLib.setSourceCover(source, custom); + } + } + + return custom; } @Override