code cleanup
authorNiki Roo <niki@nikiroo.be>
Mon, 15 Apr 2019 16:59:13 +0000 (18:59 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 15 Apr 2019 16:59:13 +0000 (18:59 +0200)
src/be/nikiroo/fanfix/reader/ui/GuiReaderBookInfo.java

index a5743c7b10f8ab80b21ff50a4aae5cf2273fbac4..3c5cc8a22ea20daec39f79452a357702c8c9057b 100644 (file)
@@ -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());