From cf45a4c44b472d0e1bbbcbc9891020366e99364c Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sat, 16 Mar 2019 22:21:10 +0100 Subject: [PATCH] fix remote default covers --- src/be/nikiroo/fanfix/library/CacheLibrary.java | 7 ++++++- src/be/nikiroo/fanfix/library/LocalLibrary.java | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index c8721dd..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 diff --git a/src/be/nikiroo/fanfix/library/LocalLibrary.java b/src/be/nikiroo/fanfix/library/LocalLibrary.java index 93bf7ba..eafd18a 100644 --- a/src/be/nikiroo/fanfix/library/LocalLibrary.java +++ b/src/be/nikiroo/fanfix/library/LocalLibrary.java @@ -265,7 +265,9 @@ public class LocalLibrary extends BasicLibrary { * the cover image */ synchronized void setSourceCover(String source, Image coverImage) { - File cover = new File(getExpectedDir(source), ".cover"); + File dir = getExpectedDir(source); + dir.mkdirs(); + File cover = new File(dir, ".cover"); try { Instance.getCache().saveAsImage(coverImage, cover, true); if (sourceCovers != null) { -- 2.27.0