[Lists] Change data source and query method

This commit is contained in:
Fosco Marotto 2020-11-20 21:04:41 -08:00
parent 180be82c06
commit 62e8f846bc
1 changed files with 6 additions and 9 deletions

View File

@ -18,6 +18,7 @@ class Api::V1::Timelines::ListController < Api::BaseController
def set_list
@list = List.where(account: current_account).find(params[:id])
@accounts = ListAccount.select('follow_id').where(list_id: @list)
end
def set_statuses
@ -29,16 +30,12 @@ class Api::V1::Timelines::ListController < Api::BaseController
end
def list_statuses
list_feed.get(
statuses = Status.where(
account: @accounts, reply: false
).paginate_by_id(
limit_param(DEFAULT_STATUSES_LIMIT),
params[:max_id],
params[:since_id],
params[:min_id]
)
end
def list_feed
ListFeed.new(@list)
params_slice(:max_id, :since_id, :min_id)
).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
end
def insert_pagination_headers