diff --git a/lib/philomena/tags.ex b/lib/philomena/tags.ex index 4a322a81..76ef6976 100644 --- a/lib/philomena/tags.ex +++ b/lib/philomena/tags.ex @@ -209,7 +209,7 @@ defmodule Philomena.Tags do new_count = Image |> join(:inner, [i], _ in assoc(i, :tags)) - |> where([_i, t], t.id == ^target_tag.id) + |> where([i, t], i.hidden_from_users == true and t.id == ^target_tag.id) |> Repo.aggregate(:count, :id) Tag diff --git a/lib/philomena_web/controllers/tag/image_controller.ex b/lib/philomena_web/controllers/tag/image_controller.ex index 52d396b9..f82670b3 100644 --- a/lib/philomena_web/controllers/tag/image_controller.ex +++ b/lib/philomena_web/controllers/tag/image_controller.ex @@ -3,7 +3,6 @@ defmodule PhilomenaWeb.Tag.ImageController do alias Philomena.Tags.Tag alias Philomena.Tags - import Ecto.Query plug PhilomenaWeb.CanaryMapPlug, update: :edit, delete: :edit plug :load_and_authorize_resource, model: Tag, id_name: "tag_id", id_field: "slug", preload: [:implied_tags], persisted: true