diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-01-10 20:07:15 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-01-10 20:07:15 -0600 |
commit | 1268277a8c203bcae515e0ccc8b3432119bafed2 (patch) | |
tree | 89fccc698a4a148f70a3ae10faf0ffef260200ec /app/controllers/api/v1/timelines | |
parent | 0090aca0453285ed6f4d55758ccd05200025d11a (diff) |
add custom filter master toggle, add media gallery mode, & fix various filter logic + caching bugs
Diffstat (limited to 'app/controllers/api/v1/timelines')
-rw-r--r-- | app/controllers/api/v1/timelines/home_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/api/v1/timelines/list_controller.rb | 10 |
2 files changed, 9 insertions, 10 deletions
diff --git a/app/controllers/api/v1/timelines/home_controller.rb b/app/controllers/api/v1/timelines/home_controller.rb index bd3bac0fe..589bc3486 100644 --- a/app/controllers/api/v1/timelines/home_controller.rb +++ b/app/controllers/api/v1/timelines/home_controller.rb @@ -23,11 +23,10 @@ class Api::V1::Timelines::HomeController < Api::BaseController end def cached_home_statuses - if current_account&.user&.hide_boosts - cache_collection home_statuses.without_reblogs, Status - else - cache_collection home_statuses, Status - end + statuses = home_statuses + statuses = statuses.without_reblogs if current_account&.user&.hide_boosts + statuses = statuses.with_media if current_account&.user&.media_only + cache_collection statuses, Status end def home_statuses diff --git a/app/controllers/api/v1/timelines/list_controller.rb b/app/controllers/api/v1/timelines/list_controller.rb index 7eb656745..b52f53bf9 100644 --- a/app/controllers/api/v1/timelines/list_controller.rb +++ b/app/controllers/api/v1/timelines/list_controller.rb @@ -25,11 +25,11 @@ class Api::V1::Timelines::ListController < Api::BaseController end def cached_list_statuses - if current_account&.user&.hide_boosts - cache_collection list_statuses.without_reblogs, Status - else - cache_collection list_statuses, Status - end + statuses = list_statuses + statuses = statuses.without_reblogs if current_account&.user&.hide_boosts + statuses = statuses.with_media if current_account&.user&.media_only + + cache_collection statuses, Status end def list_statuses |