Experiment with unifying Artwork interface for all databases
This commit is contained in:
parent
e986103a1c
commit
d616f5ab3f
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue