Updated SortingQueryBuilder for ExploreTimeline, GroupCollectionTimeline, GroupTimeline

• Updated:
- SortingQueryBuilder for ExploreTimeline, GroupCollectionTimeline, GroupTimeline

• TODO
- Test on a lot of data to ensure no repeats
- Test reducers/timeline updates to appending and concating non status.id sorted results
This commit is contained in:
mgabdev
2020-12-24 13:34:14 -05:00
parent 7dd71a06ca
commit 620f50752f
8 changed files with 95 additions and 72 deletions

View File

@@ -4,9 +4,7 @@ class Api::V1::Timelines::ExploreController < EmptyController
before_action :set_sort_type
before_action :set_statuses
after_action :insert_pagination_headers, unless: -> {
@statuses.empty?
}
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
def show
if current_user
@@ -46,9 +44,11 @@ class Api::V1::Timelines::ExploreController < EmptyController
def explore_statuses
if current_account
SortingQueryBuilder.new.call(@sort_type, params[:max_id]).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
SortingQueryBuilder.new.call(@sort_type, nil, params[:page]).reject {|status|
FeedManager.instance.filter?(:home, status, current_account.id)
}
else
SortingQueryBuilder.new.call(@sort_type, params[:max_id])
SortingQueryBuilder.new.call(@sort_type, nil, params[:page])
end
end

View File

@@ -5,9 +5,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController
before_action :set_sort_type
before_action :set_statuses
after_action :insert_pagination_headers, unless: -> {
@statuses.empty?
}
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
def show
if current_account
@@ -69,9 +67,11 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController
end
if current_account
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @groupIds).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
SortingQueryBuilder.new.call(@sort_type, @groupIds, params[:page]).reject {|status|
FeedManager.instance.filter?(:home, status, current_account.id)
}
else
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @groupIds)
SortingQueryBuilder.new.call(@sort_type, @groupIds, params[:page])
end
end

View File

@@ -5,9 +5,7 @@ class Api::V1::Timelines::GroupController < Api::BaseController
before_action :set_sort_type
before_action :set_statuses
after_action :insert_pagination_headers, unless: -> {
@statuses.empty?
}
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
def show
if current_user
@@ -52,9 +50,11 @@ class Api::V1::Timelines::GroupController < Api::BaseController
def group_statuses
if current_account
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @group).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
SortingQueryBuilder.new.call(@sort_type, @group, params[:page]).reject {|status|
FeedManager.instance.filter?(:home, status, current_account.id)
}
else
SortingQueryBuilder.new.call(@sort_type, params[:max_id], @group)
SortingQueryBuilder.new.call(@sort_type, @group, params[:page])
end
end