forked from j62/ctbrec
1
0
Fork 0

Fix: Filter was negated by refactoring

This commit is contained in:
0xboobface 2019-12-29 14:24:55 +01:00
parent 85bacb8c04
commit 4dd99a6dd3
1 changed files with 9 additions and 9 deletions

View File

@ -763,7 +763,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
String[] tokens = filter.split(" ");
boolean tokensMissing = false;
for (String token : tokens) {
if(!modelPropertiesMatchToken(token, m)) {
if (!modelPropertiesMatchToken(token, m)) {
tokensMissing = true;
}
}
@ -778,24 +778,24 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
int[] resolution = m.getStreamResolution(true);
String searchText = createSearchText(m);
boolean tokensMissing = false;
if(token.matches(">\\d+")) {
if (token.matches(">\\d+")) {
int res = Integer.parseInt(token.substring(1));
if(resolution[1] < res) {
if (resolution[1] < res) {
tokensMissing = true;
}
} else if(token.matches("<\\d+")) {
} else if (token.matches("<\\d+")) {
int res = Integer.parseInt(token.substring(1));
if(resolution[1] > res) {
if (resolution[1] > res) {
tokensMissing = true;
}
} else if(token.equals("public")) {
if(!m.getOnlineState(true).toString().equals(token)) {
} else if (token.equals("public")) {
if (m.getOnlineState(true) != ctbrec.Model.State.ONLINE) {
tokensMissing = true;
}
} else if(!searchText.toLowerCase().contains(token.toLowerCase())) {
} else if (!searchText.toLowerCase().contains(token.toLowerCase())) {
tokensMissing = true;
}
return tokensMissing;
return !tokensMissing;
}
private String createSearchText(Model m) throws ExecutionException {