diff --git a/app/services/discourse_rewind/action/favorite_categories.rb b/app/services/discourse_rewind/action/favorite_categories.rb index c0d4f76..641ae18 100644 --- a/app/services/discourse_rewind/action/favorite_categories.rb +++ b/app/services/discourse_rewind/action/favorite_categories.rb @@ -23,6 +23,7 @@ module DiscourseRewind .joins("INNER JOIN categories ON categories.id = topics.category_id") .where(user: user) .where(viewed_at: date) + .where(categories: { id: user.guardian.allowed_category_ids }) .group("categories.id, categories.name") .order("COUNT(*) DESC") .limit(5) diff --git a/app/services/discourse_rewind/action/favorite_tags.rb b/app/services/discourse_rewind/action/favorite_tags.rb index 0c75c72..112268d 100644 --- a/app/services/discourse_rewind/action/favorite_tags.rb +++ b/app/services/discourse_rewind/action/favorite_tags.rb @@ -25,6 +25,7 @@ module DiscourseRewind .joins("INNER JOIN tags ON tags.id = topic_tags.tag_id") .where(user: user) .where(viewed_at: date) + .where(tags: { id: Tag.visible(user.guardian).pluck(:id) }) .group("tags.id, tags.name") .order("COUNT(DISTINCT topic_views.topic_id) DESC") .limit(5) diff --git a/app/services/discourse_rewind/fetch_reports.rb b/app/services/discourse_rewind/fetch_reports.rb index e88f1cc..361711f 100644 --- a/app/services/discourse_rewind/fetch_reports.rb +++ b/app/services/discourse_rewind/fetch_reports.rb @@ -26,7 +26,7 @@ module DiscourseRewind Action::ReadingTime, Action::Reactions, Action::Fbff, - # Action::FavoriteTags, + Action::FavoriteTags, Action::FavoriteCategories, Action::BestTopics, Action::BestPosts,