about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/api/v1/timelines/public_controller.rb7
-rw-r--r--app/controllers/api/v1/timelines/tag_controller.rb13
2 files changed, 12 insertions, 8 deletions
diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb
index 9d226ba5a..e5f38508c 100644
--- a/app/controllers/api/v1/timelines/public_controller.rb
+++ b/app/controllers/api/v1/timelines/public_controller.rb
@@ -23,11 +23,10 @@ class Api::V1::Timelines::PublicController < Api::BaseController
 
   def public_statuses
     ptl = public_timeline_statuses
-    ptl_preload = ptl.paginate_by_id(
-      limit_param(DEFAULT_STATUSES_LIMIT * 2),
+    preload_media(ptl.paginate_by_id(
+      DEFAULT_STATUSES_LIMIT * 2,
       params_slice(:max_id, :since_id, :min_id)
-    )
-    preload_media(ptl_preload)
+    ))
     statuses = ptl.paginate_by_id(
       limit_param(DEFAULT_STATUSES_LIMIT),
       params_slice(:max_id, :since_id, :min_id)
diff --git a/app/controllers/api/v1/timelines/tag_controller.rb b/app/controllers/api/v1/timelines/tag_controller.rb
index 4641d6941..01d1b30b8 100644
--- a/app/controllers/api/v1/timelines/tag_controller.rb
+++ b/app/controllers/api/v1/timelines/tag_controller.rb
@@ -29,9 +29,16 @@ class Api::V1::Timelines::TagController < Api::BaseController
     if @tag.nil?
       []
     elsif @tag.name.in?(['self.bookmarks', '.self.bookmarks'])
-      Status.reorder(nil).joins(:bookmarks).merge(bookmark_results)
+      bookmarks = Status.reorder(nil).joins(:bookmarks).merge(bookmark_results)
+      preload_media(bookmarks)
+      bookmarks
     else
-      statuses = tag_timeline_statuses.paginate_by_id(
+      tag_timeline = tag_timeline_statuses
+      preload_media(tag_timeline.paginate_by_id(
+        DEFAULT_STATUSES_LIMIT * 2,
+        params_slice(:max_id, :since_id, :min_id)
+      ))
+      statuses = tag_timeline.paginate_by_id(
         limit_param(DEFAULT_STATUSES_LIMIT),
         params_slice(:max_id, :since_id, :min_id)
       )
@@ -51,8 +58,6 @@ class Api::V1::Timelines::TagController < Api::BaseController
   end
 
   def bookmark_results
-    bookmarks = account_bookmarks
-    preload_media(bookmarks)
     @_results ||= bookmarks.paginate_by_max_id(
       limit_param(DEFAULT_STATUSES_LIMIT),
       params[:max_id],