Skip to content

Commit

Permalink
1.7: Allow filter testing when bean disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
parg committed Feb 28, 2021
1 parent 8b0330c commit 19a2e11
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RSSFEED CHANGELOG - Changes by [email protected]
---------------------------------------------
1.7 - Allow testing of filters when filter is disabled [Parg]
1.6.9 - Fail feed updates if forced-bind address is missing [Parg]
1.6.8 - Change to using Tree instead of TableTree as deprecated and not working on Linux [Parg]
1.6.7 - Fix internationalisation issue with config save [Parg]
Expand Down
9 changes: 6 additions & 3 deletions org/kmallan/azureus/rssfeed/FilterBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public boolean matches(long urlId, String title, String link) {
if(!getEnabled()) return false;
if(getFeed() != 0 && urlId != getFeed()) return false;
public boolean matches(long urlId, String title, String link, boolean testOnly) {
if ( !testOnly){
if(!getEnabled()) return false;

if(getFeed() != 0 && urlId != getFeed()) return false;
}

boolean matched = false;
if((getMatchTitle()) && (match(title))) matched = true;
Expand Down
2 changes: 1 addition & 1 deletion org/kmallan/azureus/rssfeed/Scheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public void run() {
for(int i = 0; i < view.rssfeedConfig.getFilterCount(); i++) {
curFilter = view.rssfeedConfig.getFilter(i);
if(curFilter == null) continue;
if(curFilter.matches(urlBean.getID(), titleTest, linkTest)) {
if(curFilter.matches(urlBean.getID(), titleTest, linkTest, false)) {
if(curFilter.getModeIndex() == FilterBean.MODE_PASS ) {
state = ListBean.DOWNLOAD_INCL;
} else {
Expand Down
2 changes: 1 addition & 1 deletion org/kmallan/azureus/rssfeed/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ private void filtTest() {
String testStr = filtTestMatch.getText();
if(testStr != null) {
testStr = testStr.toLowerCase();
boolean match = FilterTableItem.save(null, thisView).matches(0, testStr, testStr);
boolean match = FilterTableItem.save(null, thisView).matches(0, testStr, testStr,true);
Color green = display.getSystemColor(SWT.COLOR_GREEN);
Color red = display.getSystemColor(SWT.COLOR_RED);
filtTestMatch.setBackground(match?green:red);
Expand Down
2 changes: 1 addition & 1 deletion plugin.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugin.id=rssfeed
plugin.name=RSSFeed Scanner
plugin.version=1.6.9
plugin.class=org.kmallan.azureus.rssfeed.Plugin
plugin.langfile=org.kmallan.resource.lang.Messages
plugin.version=1.7

0 comments on commit 19a2e11

Please sign in to comment.