diff options
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r-- | server/lib/client-html.ts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 2f6bce1c7..3c09332b5 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -208,14 +208,12 @@ class ClientHtml { | |||
208 | } | 208 | } |
209 | 209 | ||
210 | static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | 210 | static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { |
211 | const accountModel = await AccountModel.loadByNameWithHost(nameWithHost) | 211 | const [ account, channel ] = await Promise.all([ |
212 | AccountModel.loadByNameWithHost(nameWithHost), | ||
213 | VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost) | ||
214 | ]) | ||
212 | 215 | ||
213 | if (accountModel) { | 216 | return this.getAccountOrChannelHTMLPage(() => Promise.resolve(account || channel), req, res) |
214 | return this.getAccountOrChannelHTMLPage(() => new Promise(resolve => resolve(accountModel)), req, res) | ||
215 | } else { | ||
216 | const videoChannelModelPromise = VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost) | ||
217 | return this.getAccountOrChannelHTMLPage(() => videoChannelModelPromise, req, res) | ||
218 | } | ||
219 | } | 217 | } |
220 | 218 | ||
221 | static async getEmbedHTML () { | 219 | static async getEmbedHTML () { |