X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FCacheLibrary.java;h=0f283183b620006188040d0e59c84b3025e7f9e7;hb=3989dfc5ced262e3c8d07fc796ec06ce5513c6b8;hp=918b763ff376b9a07075aceb41bff4023936f5e5;hpb=116904b8f8386091f978c0c678343c2f1cc80356;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index 918b763..0f28318 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -125,6 +125,22 @@ public class CacheLibrary extends BasicLibrary { return lib.getSourceCover(source); } + @Override + public Image getAuthorCover(String author) { + Image custom = getCustomSourceCover(author); + if (custom != null) { + return custom; + } + + Image cached = cacheLib.getSourceCover(author); + if (cached != null) { + return cached; + } + + return lib.getSourceCover(author); + + } + @Override public Image getCustomSourceCover(String source) { Image custom = cacheLib.getCustomSourceCover(source); @@ -137,6 +153,19 @@ public class CacheLibrary extends BasicLibrary { return custom; } + + @Override + public Image getCustomAuthorCover(String author) { + Image custom = cacheLib.getCustomAuthorCover(author); + if (custom == null) { + custom = lib.getCustomAuthorCover(author); + if (custom != null) { + cacheLib.setAuthorCover(author, custom); + } + } + + return custom; + } @Override public void setSourceCover(String source, String luid) { @@ -144,6 +173,12 @@ public class CacheLibrary extends BasicLibrary { cacheLib.setSourceCover(source, getCover(luid)); } + @Override + public void setAuthorCover(String author, String luid) { + lib.setAuthorCover(author, luid); + cacheLib.setAuthorCover(author, getCover(luid)); + } + @Override protected void updateInfo(MetaData meta) { if (meta != null && metas != null) {