diff --git a/app/controllers/api/v1/timelines/tag_controller.rb b/app/controllers/api/v1/timelines/tag_controller.rb index 31cd5e96..777be45f 100644 --- a/app/controllers/api/v1/timelines/tag_controller.rb +++ b/app/controllers/api/v1/timelines/tag_controller.rb @@ -8,7 +8,7 @@ class Api::V1::Timelines::TagController < Api::BaseController respond_to :json def show - @statuses = load_statuses + @statuses = tagged_statuses render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id) end @@ -18,14 +18,6 @@ class Api::V1::Timelines::TagController < Api::BaseController @tag = Tag.find_normalized(params[:id]) end - def load_statuses - cached_tagged_statuses - end - - def cached_tagged_statuses - cache_collection tagged_statuses, Status - end - def tagged_statuses if @tag.nil? [] @@ -35,13 +27,7 @@ class Api::V1::Timelines::TagController < Api::BaseController params_slice(:max_id, :since_id, :min_id) ) - if truthy_param?(:only_media) - # `SELECT DISTINCT id, updated_at` is too slow, so pluck ids at first, and then select id, updated_at with ids. - status_ids = statuses.joins(:media_attachments).distinct(:id).pluck(:id) - statuses.where(id: status_ids) - else - statuses - end + statuses end end