Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Filter problem #124

Closed
ntoulasd opened this issue Nov 22, 2015 · 9 comments
Closed

Filter problem #124

ntoulasd opened this issue Nov 22, 2015 · 9 comments

Comments

@ntoulasd
Copy link

I made a filter for a feed but filter doesn't work.
I choose to Accept feed with the SV word at title.

Also in the middle of the screen there is No rules message but the rule is over there.

@blindbox
Copy link

blindbox commented Dec 8, 2015

The middle of the screen no rules message is a render bug.

As far as the feed filter goes, you need to have at least one reject filter, for the feed filter to work.

The code goes like this: -

  1. If it's not tagged by any rule, the entry is considered accepted. Hence, unless there's at least 1 reject rule, ALL entries will be accepted.
  2. If you made a filter to reject an entry, that entry will be rejected, however, an accept rule WILL override a reject rule.
  3. If none of the accept rule triggered, but at least one reject rule is triggered, then the entry is rejected.

So, what you can do is:-

step 1: Add a filter that rejects everything.
step 2: Add an accept filter.
step 3: Done

Reference:
spaRSS/mobile/src/main/java/net/etuldan/sparss/parser/RssAtomParser.java
Find this method
public boolean isEntryFiltered(String title, String content) {
See also issue #143. I'll be working on it, but no promises and if someone wishes to take over, go ahead, do it without asking. I'm doing this for the experience.

@Etuldan
Copy link
Owner

Etuldan commented Dec 8, 2015

Thank you blindbox for explaining the filter feature :)

I didn't understand the "Also in the middle of the screen there is No rules message but the rule is over there." issue. Could you make a screenshot of it ?

@blindbox
Copy link

blindbox commented Dec 8, 2015

He's talking about this. Notice how I have a filter rule, but it still says 'No rules'

screenshot_2015-12-08-21-00-54 arrow

@Etuldan
Copy link
Owner

Etuldan commented Dec 8, 2015

Indeed, reproduced on my device, I'll try to fix it.

@ntoulasd
Copy link
Author

ntoulasd commented Dec 8, 2015

Thanks blindbox for your information. I make a reject rule and now filtering is working.

I would like to recommend filtering works like that.
Accept this
Accept that
Reject all

or
Reject this
Reject that
Accept all

This way is working in Linux iptables and many other filter list.

@blindbox
Copy link

blindbox commented Dec 8, 2015

I'll have to insist that you use the method that spaRSS provides. :)

I have three problems.

One, it's a design issue:- I don't know where I should put the button to toggle between behaviours. This is a lame excuse.

Two, where do I store the behaviour variable per feed? That's actually a difficult question. I need to study the source code further before I could find out where. @Etuldan probably knows better on this.

Three, the current filter system works for me. This is my attitude towards these things unfortunately. It's working just fine for me, and so, I won't be tackling this issue. Sorry, I'm more towards bug hunting!

If anyone's doing this, make sure you guys put it as an option so that users who expect the old behaviour won't storm github.

@Etuldan
Copy link
Owner

Etuldan commented Dec 8, 2015

  • Design issue : I think if we add this switch, it should be global. But, see 2nd point about inconsistency.
  • Behaviour variable : We can add a boolean (or multistate variable) in the private database (as I already done for cookies and http auth), per feed. But see 1rst point, better to use global switch, however, the database and global config could be inconsistent when reimporting.
  • Current / requested : agree, but I as already said, I personally don't use the filter feature, so I don't know how it's easy/hard/userfriendly to setup filters. I 'a lot' of user report that the current system is bad, I'll probably switch to a new one (with backward compatibility)

@blindbox
Copy link

blindbox commented Dec 8, 2015

  • Behaviour variable: I don't like having a global switch for this. Global switch to toggle between old and new behaviour, sure. However, some people might want a whitelist on some feeds, and blacklist on some other feeds. I can surely think of such use cases.
  • Current / requested: All right, for now, that filter help button is our stopgap measure. I've done the docs and everything, only thing left is to commit and do a pull request.

@ntoulasd
Copy link
Author

ntoulasd commented Dec 8, 2015

Solutions :
You may add 2 more filter types.
ACCEPT
ACCEPT ALL
REJECT
REJECT ALL

In ACCEPT ALL / REJECT ALL no further input is required.
You may consider that Reject All is a reject with regular expression .*

So no design issue, no store the behaviour issue.

No pressure, if you think everything is all right, I agree. Just make some documentation and everything is ok.

blindbox added a commit to blindbox/spaRSS that referenced this issue Dec 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants