Experiment with unifying Artwork interface for all databases
This commit is contained in:
parent
d616f5ab3f
commit
90ecf3c0a7
|
@ -45,8 +45,8 @@ public class Artwork implements Serializable {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLanguage() {
|
public Locale getLanguage() {
|
||||||
return language;
|
return language == null ? null : new Locale(language);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getRating() {
|
public double getRating() {
|
||||||
|
@ -54,7 +54,9 @@ public class Artwork implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matches(String... tags) {
|
public boolean matches(String... tags) {
|
||||||
return stream(tags).filter(Objects::nonNull).allMatch(tag -> stream(category).anyMatch(tag::equals));
|
return stream(tags).filter(Objects::nonNull).allMatch(tag -> {
|
||||||
|
return stream(category).anyMatch(tag::equalsIgnoreCase) || tag.equalsIgnoreCase(language);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue