mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
Filter banned subreddits from search results
This commit is contained in:
@@ -583,6 +583,9 @@ class SearchBuilder(IDBuilder):
|
||||
# TODO: Consider a flag to disable this (and see listingcontroller.py)
|
||||
if item._spam or item._deleted:
|
||||
return False
|
||||
# If checking (wrapped) links, filter out banned subreddits
|
||||
elif hasattr(item, 'subreddit') and item.subreddit.spammy():
|
||||
return False
|
||||
elif (self.skip_deleted_authors and
|
||||
getattr(item, "author", None) and item.author._deleted):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user