From 62e8f846bcab5a7630bccd9267199e1835aff92b Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Fri, 20 Nov 2020 21:04:41 -0800 Subject: [PATCH] [Lists] Change data source and query method --- .../api/v1/timelines/list_controller.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/controllers/api/v1/timelines/list_controller.rb b/app/controllers/api/v1/timelines/list_controller.rb index a15eae46..0d1b3746 100644 --- a/app/controllers/api/v1/timelines/list_controller.rb +++ b/app/controllers/api/v1/timelines/list_controller.rb @@ -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