From d4a992bf4e8488edb3316e528c8f9b9319f875bf Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 15 Apr 2019 18:59:13 +0200 Subject: [PATCH] code cleanup --- .../nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java index a5743c7b..3c5cc8a2 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java @@ -127,7 +127,15 @@ public class GuiReaderBookInfo { public Image getBaseImage(BasicLibrary lib) { switch (type) { case STORY: - return lib.getCover(meta.getLuid()); + if (meta.getCover() != null) { + return meta.getCover(); + } + + if (meta.getLuid() != null) { + return lib.getCover(meta.getLuid()); + } + + return null; case SOURCE: return lib.getSourceCover(value); case AUTHOR: @@ -150,6 +158,9 @@ public class GuiReaderBookInfo { if (uid == null || uid.trim().isEmpty()) { uid = meta.getLuid(); } + if (uid == null || uid.trim().isEmpty()) { + uid = meta.getUrl(); + } GuiReaderBookInfo info = new GuiReaderBookInfo(Type.STORY, uid, meta.getTitle()); -- 2.27.0