[sorting query builder] Adjust filtering
This commit is contained in:
@@ -44,9 +44,10 @@ class Api::V1::Timelines::ExploreController < Api::BaseController
|
||||
|
||||
def explore_statuses
|
||||
if current_account
|
||||
SortingQueryBuilder.new.call(@sort_type, nil, params[:page]).reject {|status|
|
||||
FeedManager.instance.filter?(:home, status, current_account.id)
|
||||
}
|
||||
SortingQueryBuilder.new.call(@sort_type, nil, params[:page], current_account)
|
||||
.reject {|status|
|
||||
FeedManager.instance.filter?(:home, status, current_account.id)
|
||||
}
|
||||
else
|
||||
page = [params[:page].to_i.abs, MIN_UNAUTHENTICATED_PAGES].min
|
||||
SortingQueryBuilder.new.call(@sort_type, nil, page)
|
||||
|
||||
@@ -43,7 +43,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController
|
||||
'top_yearly',
|
||||
'top_all_time',
|
||||
].include? params[:sort_by]
|
||||
|
||||
|
||||
if @collection_type === 'featured' && (@sort_type == 'newest' || @sort_type == 'recent')
|
||||
@sort_type = 'hot'
|
||||
end
|
||||
@@ -66,9 +66,9 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController
|
||||
elsif @collection_type == 'member' && !current_account.nil?
|
||||
@groupIds = current_account.groups.pluck(:id)
|
||||
end
|
||||
|
||||
|
||||
if current_account
|
||||
SortingQueryBuilder.new.call(@sort_type, @groupIds, params[:page]).reject {|status|
|
||||
SortingQueryBuilder.new.call(@sort_type, @groupIds, params[:page], current_account).reject {|status|
|
||||
FeedManager.instance.filter?(:home, status, current_account.id)
|
||||
}
|
||||
else
|
||||
|
||||
@@ -51,7 +51,7 @@ class Api::V1::Timelines::GroupController < Api::BaseController
|
||||
|
||||
def group_statuses
|
||||
if current_account
|
||||
SortingQueryBuilder.new.call(@sort_type, @group, params[:page]).reject {|status|
|
||||
SortingQueryBuilder.new.call(@sort_type, @group, params[:page], current_account).reject {|status|
|
||||
FeedManager.instance.filter?(:home, status, current_account.id)
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user