1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Refactor Language

This commit is contained in:
Reinhard Pointner 2017-01-14 05:04:44 +08:00
parent b5a031c7c4
commit 738089a6fc

View File

@ -84,17 +84,7 @@ public class Language implements Serializable {
} }
public boolean matches(String code) { public boolean matches(String code) {
if (Stream.of(iso_639_1, iso_639_2B, iso_639_3, tag).anyMatch(c -> c.equalsIgnoreCase(code))) { return Stream.concat(Stream.of(iso_639_1, iso_639_2B, iso_639_3, tag), Stream.of(names)).anyMatch(c -> c.equalsIgnoreCase(code));
return true;
}
for (String c : names) {
if (c.equalsIgnoreCase(code) || code.toLowerCase().contains(c.toLowerCase())) {
return true;
}
}
return false;
} }
@Override @Override