[Lists] Change data source and query method
This commit is contained in:
parent
180be82c06
commit
62e8f846bc
|
@ -18,6 +18,7 @@ class Api::V1::Timelines::ListController < Api::BaseController
|
||||||
|
|
||||||
def set_list
|
def set_list
|
||||||
@list = List.where(account: current_account).find(params[:id])
|
@list = List.where(account: current_account).find(params[:id])
|
||||||
|
@accounts = ListAccount.select('follow_id').where(list_id: @list)
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_statuses
|
def set_statuses
|
||||||
|
@ -29,16 +30,12 @@ class Api::V1::Timelines::ListController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_statuses
|
def list_statuses
|
||||||
list_feed.get(
|
statuses = Status.where(
|
||||||
|
account: @accounts, reply: false
|
||||||
|
).paginate_by_id(
|
||||||
limit_param(DEFAULT_STATUSES_LIMIT),
|
limit_param(DEFAULT_STATUSES_LIMIT),
|
||||||
params[:max_id],
|
params_slice(:max_id, :since_id, :min_id)
|
||||||
params[:since_id],
|
).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
|
||||||
params[:min_id]
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
def list_feed
|
|
||||||
ListFeed.new(@list)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def insert_pagination_headers
|
def insert_pagination_headers
|
||||||
|
|
Loading…
Reference in New Issue