mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-07 23:06:42 +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 =
|
streams =
|
||||||
Channel
|
Channel
|
||||||
|> where([c], c.nsfw == false)
|
|
||||||
|> where([c], not is_nil(c.last_fetched_at))
|
|> where([c], not is_nil(c.last_fetched_at))
|
||||||
|
|> maybe_show_nsfw_channels(conn.cookies["chan_nsfw"])
|
||||||
|> order_by(desc: :is_live, asc: :title)
|
|> order_by(desc: :is_live, asc: :title)
|
||||||
|> limit(6)
|
|> limit(6)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
|
@ -142,6 +142,9 @@ defmodule PhilomenaWeb.ActivityController do
|
||||||
)
|
)
|
||||||
end
|
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
|
defp multi_search(images, top_scoring, comments, nil) do
|
||||||
responses =
|
responses =
|
||||||
Search.msearch_records(
|
Search.msearch_records(
|
||||||
|
|
Loading…
Reference in a new issue