Only return a title if an image is found
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Aug 2015 19:18:12 +0000 (21:18 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Aug 2015 19:18:12 +0000 (21:18 +0200)
src/main/java/net/pterodactylus/rhynodge/filters/comics/HeldentageFilter.java

index a1f1636..7081656 100644 (file)
@@ -1,6 +1,7 @@
 package net.pterodactylus.rhynodge.filters.comics;
 
 import static com.google.common.base.Optional.absent;
+import static com.google.common.base.Optional.of;
 import static java.util.Collections.emptyList;
 import static java.util.stream.Collectors.toList;
 
@@ -20,7 +21,7 @@ public class HeldentageFilter extends ComicSiteFilter {
 
        @Override
        protected Optional<String> extractTitle(Document document) {
-               return absent();
+               return extractImageUrls(document).isEmpty() ? absent() : of("");
        }
 
        @Override