RedReader
RedReader copied to clipboard
[Feature request] blacklist post titles
It would be nice to have a blacklist of strings for post titles, e.g. "cat", "dog", "mods are asleep", ... Nothing fancy (regex), just plain case-insensitive search.
Hope that's not a duplicate - I could only find requests for tag/url-based filters. Thanks for the nice project.
Totally with you, so many use-cases
I'm also interested in this potential feature. Are there any key devs reading this post that could point me in the right direction? I.e. what class(es) would need to be changed to accommodate?
Thanks for taking the time to read and hopefully reply :)
Edit. Paging @QuantumBadger are you able to help?
@Rub-z There are two major parts to implementing this, which are:
- Make some suitable UI to set the preference
- Filter posts before they're displayed based on that preference
(2) is fairly easy, the relevant class is PostListingFragment. Care needs to be taken to make sure this doesn't break related features like blocking subreddits or restricting post count.
https://github.com/QuantumBadger/RedReader/blob/master/src/main/java/org/quantumbadger/redreader/fragments/PostListingFragment.java
In terms of the UI, it would be good to have a list where you can add/edit/delete entries, similar to the following random example off Google Images :)

Relevant files are:
https://github.com/QuantumBadger/RedReader/blob/master/src/main/res/xml/prefs_behaviour.xml
https://github.com/QuantumBadger/RedReader/blob/master/src/main/java/org/quantumbadger/redreader/common/PrefsUtility.java
https://github.com/QuantumBadger/RedReader/blob/master/src/main/java/org/quantumbadger/redreader/settings/SettingsFragment.java
If you have any questions let me know :)
Hi QuantumBadger!
Many thanks for the insights :)
I'd worked out that the PostListingFragment was key but this additional information is brilliant!
In regards to (1) the UI, is Settings > Behaviour > Posts a good place?
Another option, 'Post Filtering', could be added which would direct you to a list of strings as per your image.
I won't be able to properly look at the codebase until next week but will definitely take you up on any offer of advice for sure when I do!
Many thanks for replying :)
No problem :) Thanks for looking into implementing this!
In regards to (1) the UI, is Settings > Behaviour > Posts a good place?
Another option, 'Post Filtering', could be added which would direct you to a list of strings as per your image.
Yep, that sounds good to me.
No problem :) Thanks for looking into implementing this!
In regards to (1) the UI, is Settings > Behaviour > Posts a good place? Another option, 'Post Filtering', could be added which would direct you to a list of strings as per your image.
Yep, that sounds good to me.
Hi @QuantumBadger
Sorry for taking so long to get around to this...
I have pretty much done what we discussed except I ran into a couple of issues and didn't want to mess up the code so kept it simple... My main computer packed in so the only way for me to debug the code was installing the apk on the phone :/
Hopefully this is 95% done and you can take the files I've provided and merge (once you've taken a look and made any required changes).
So the list 'Keyword Filter List' has just been implemented as comma separeted Preference string:


This is working correctly.
However the post filtering is not working (I don't think the post.name is the 'Post Title'). Perhaps you could take a look?

Please find the attached the files I've made changes to:

ZIP password is 'redreader'
Cheers.
Has this made it through into the development version? I'd like something where I can filter, ideally by regex, on the body of the post, but a filter by title should be easier to extend.
Any progress on this? Need ability to hide posts by keyword, hide posts with certain flair in subreddits, hide users