diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/client-html.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 4b2968e8b..2f6bce1c7 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -198,11 +198,24 @@ class ClientHtml { | |||
198 | } | 198 | } |
199 | 199 | ||
200 | static async getAccountHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | 200 | static async getAccountHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { |
201 | return this.getAccountOrChannelHTMLPage(() => AccountModel.loadByNameWithHost(nameWithHost), req, res) | 201 | const accountModelPromise = AccountModel.loadByNameWithHost(nameWithHost) |
202 | return this.getAccountOrChannelHTMLPage(() => accountModelPromise, req, res) | ||
202 | } | 203 | } |
203 | 204 | ||
204 | static async getVideoChannelHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | 205 | static async getVideoChannelHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { |
205 | return this.getAccountOrChannelHTMLPage(() => VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost), req, res) | 206 | const videoChannelModelPromise = VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost) |
207 | return this.getAccountOrChannelHTMLPage(() => videoChannelModelPromise, req, res) | ||
208 | } | ||
209 | |||
210 | static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | ||
211 | const accountModel = await AccountModel.loadByNameWithHost(nameWithHost) | ||
212 | |||
213 | if (accountModel) { | ||
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 | } | ||
206 | } | 219 | } |
207 | 220 | ||
208 | static async getEmbedHTML () { | 221 | static async getEmbedHTML () { |