mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
exclude banned and nsfw sites from suggestions
This commit is contained in:
parent
ded6275c71
commit
1553229b95
1 changed files with 1 additions and 1 deletions
|
@ -1029,7 +1029,7 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
def suggestions(limit=SUGGESTIONS_LIMIT, offset=0)
|
||||
suggestions_dataset = Site.exclude(id: id).order(:views.desc, :updated_at.desc)
|
||||
suggestions_dataset = Site.exclude(id: id).exclude(is_banned: true).exclude(is_nsfw: true).order(:views.desc, :updated_at.desc)
|
||||
suggestions = suggestions_dataset.where(tags: tags).limit(limit, offset).all
|
||||
|
||||
return suggestions if suggestions.length == limit
|
||||
|
|
Loading…
Add table
Reference in a new issue