diff --git a/source/net/filebot/web/Artwork.java b/source/net/filebot/web/Artwork.java index da6c8a8a..184c64ed 100644 --- a/source/net/filebot/web/Artwork.java +++ b/source/net/filebot/web/Artwork.java @@ -53,8 +53,8 @@ public class Artwork implements Serializable { return rating; } - public boolean matches(String tag) { - return stream(category).anyMatch(tag::equals); + public boolean matches(String... tags) { + return stream(tags).filter(Objects::nonNull).allMatch(tag -> stream(category).anyMatch(tag::equals)); } @Override diff --git a/test/net/filebot/web/TheTVDBClient2Test.java b/test/net/filebot/web/TheTVDBClient2Test.java index f99c84f9..c3a593dc 100644 --- a/test/net/filebot/web/TheTVDBClient2Test.java +++ b/test/net/filebot/web/TheTVDBClient2Test.java @@ -138,6 +138,8 @@ public class TheTVDBClient2Test { assertEquals("[fanart, 1280x720]", i.getCategory().toString()); assertEquals("http://thetvdb.com/banners/fanart/original/70327-1.jpg", i.getUrl().toString()); + assertTrue(i.matches("fanart", "1280x720")); + assertFalse(i.matches("fanart", "1280x720", "1")); } }