mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-31 19:36:44 +01:00
Show NSFW channels on Activity page when chan_nsfw
is on
This commit is contained in:
parent
c328cb9cb5
commit
ce0ae607dc
1 changed files with 4 additions and 1 deletions
|
@ -82,8 +82,8 @@ defmodule PhilomenaWeb.ActivityController do
|
|||
|
||||
streams =
|
||||
Channel
|
||||
|> where([c], c.nsfw == false)
|
||||
|> where([c], not is_nil(c.last_fetched_at))
|
||||
|> maybe_show_nsfw_channels(conn.cookies["chan_nsfw"])
|
||||
|> order_by(desc: :is_live, asc: :title)
|
||||
|> limit(6)
|
||||
|> Repo.all()
|
||||
|
@ -142,6 +142,9 @@ defmodule PhilomenaWeb.ActivityController do
|
|||
)
|
||||
end
|
||||
|
||||
defp maybe_show_nsfw_channels(query, "true"), do: query
|
||||
defp maybe_show_nsfw_channels(query, _falsy), do: where(query, [c], c.nsfw == false)
|
||||
|
||||
defp multi_search(images, top_scoring, comments, nil) do
|
||||
responses =
|
||||
Search.msearch_records(
|
||||
|
|
Loading…
Reference in a new issue