From: David ‘Bombe’ Roden Date: Wed, 26 Aug 2015 19:18:12 +0000 (+0200) Subject: Only return a title if an image is found X-Git-Tag: v2~155 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=69d447cc799fe71306d66a495e53698f0bab77c1;p=rhynodge.git Only return a title if an image is found --- diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/comics/HeldentageFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/comics/HeldentageFilter.java index a1f1636..7081656 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/comics/HeldentageFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/comics/HeldentageFilter.java @@ -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 extractTitle(Document document) { - return absent(); + return extractImageUrls(document).isEmpty() ? absent() : of(""); } @Override