[explore] Remove group posts from explore page.
This commit is contained in:
parent
4adbadddaa
commit
81489b7a17
|
@ -44,12 +44,12 @@ class Api::V1::Timelines::ExploreController < Api::BaseController
|
||||||
|
|
||||||
def explore_statuses
|
def explore_statuses
|
||||||
if current_account
|
if current_account
|
||||||
SortingQueryBuilder.new.call(@sort_type, nil, params[:page]).reject {|status|
|
SortingQueryBuilder.new.call(@sort_type, nil, params[:page], nil, "explore").reject {|status|
|
||||||
FeedManager.instance.filter?(:home, status, current_account.id)
|
FeedManager.instance.filter?(:home, status, current_account.id)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
page = [params[:page].to_i.abs, MIN_UNAUTHENTICATED_PAGES].min
|
page = [params[:page].to_i.abs, MIN_UNAUTHENTICATED_PAGES].min
|
||||||
SortingQueryBuilder.new.call(@sort_type, nil, page)
|
SortingQueryBuilder.new.call(@sort_type, nil, page, nil, "explore")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,11 @@ class SortingQueryBuilder < BaseService
|
||||||
query = Status.without_replies.without_reblogs
|
query = Status.without_replies.without_reblogs
|
||||||
query = query.with_public_visibility if group.nil?
|
query = query.with_public_visibility if group.nil?
|
||||||
query = query.where('statuses.created_at > ?', date_limit)
|
query = query.where('statuses.created_at > ?', date_limit)
|
||||||
query = query.where(group: group) unless group.nil?
|
if source == "explore"
|
||||||
|
query = query.where(group: nil)
|
||||||
|
else
|
||||||
|
query = query.where(group: group) unless group.nil?
|
||||||
|
end
|
||||||
query = query.page(page.to_i)
|
query = query.page(page.to_i)
|
||||||
query = query.per(limit)
|
query = query.per(limit)
|
||||||
return query
|
return query
|
||||||
|
@ -105,7 +109,11 @@ class SortingQueryBuilder < BaseService
|
||||||
query = query.joins(:status)
|
query = query.joins(:status)
|
||||||
query = query.where('statuses.reblog_of_id IS NULL')
|
query = query.where('statuses.reblog_of_id IS NULL')
|
||||||
query = query.where('statuses.in_reply_to_id IS NULL')
|
query = query.where('statuses.in_reply_to_id IS NULL')
|
||||||
query = query.where('statuses.group_id': group) unless group.nil?
|
if source == "explore"
|
||||||
|
query = query.where('statuses.group_id': nil)
|
||||||
|
else
|
||||||
|
query = query.where('statuses.group_id': group) unless group.nil?
|
||||||
|
end
|
||||||
query = query.where('statuses.visibility': 0) if group.nil?
|
query = query.where('statuses.visibility': 0) if group.nil?
|
||||||
query = query.page(page)
|
query = query.page(page)
|
||||||
query = query.per(limit)
|
query = query.per(limit)
|
||||||
|
|
Loading…
Reference in New Issue