Load all users at once in timelines.

This commit is contained in:
lain 2018-04-02 16:27:36 +02:00
commit b3b7ab5d9a
5 changed files with 94 additions and 30 deletions

View file

@ -513,10 +513,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
)
statuses = Repo.all(q) ++ fetched
tags = String.split(query)
|> Enum.uniq()
|> Enum.filter(fn tag -> String.starts_with?(tag, "#") end)
|> Enum.map(fn tag -> String.slice(tag, 1..-1) end)
tags =
String.split(query)
|> Enum.uniq()
|> Enum.filter(fn tag -> String.starts_with?(tag, "#") end)
|> Enum.map(fn tag -> String.slice(tag, 1..-1) end)
res = %{
"accounts" => AccountView.render("accounts.json", users: accounts, for: user, as: :user),