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 203bd3893..cac9edb30 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -196,11 +196,24 @@ class ClientHtml { | |||
196 | } | 196 | } |
197 | 197 | ||
198 | static async getAccountHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | 198 | static async getAccountHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { |
199 | return this.getAccountOrChannelHTMLPage(() => AccountModel.loadByNameWithHost(nameWithHost), req, res) | 199 | const accountModelPromise = AccountModel.loadByNameWithHost(nameWithHost) |
200 | return this.getAccountOrChannelHTMLPage(() => accountModelPromise, req, res) | ||
200 | } | 201 | } |
201 | 202 | ||
202 | static async getVideoChannelHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | 203 | static async getVideoChannelHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { |
203 | return this.getAccountOrChannelHTMLPage(() => VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost), req, res) | 204 | const videoChannelModelPromise = VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost) |
205 | return this.getAccountOrChannelHTMLPage(() => videoChannelModelPromise, req, res) | ||
206 | } | ||
207 | |||
208 | static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) { | ||
209 | const accountModel = await AccountModel.loadByNameWithHost(nameWithHost) | ||
210 | |||
211 | if (accountModel) { | ||
212 | return this.getAccountOrChannelHTMLPage(() => new Promise(resolve => resolve(accountModel)), req, res) | ||
213 | } else { | ||
214 | const videoChannelModelPromise = VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost) | ||
215 | return this.getAccountOrChannelHTMLPage(() => videoChannelModelPromise, req, res) | ||
216 | } | ||
204 | } | 217 | } |
205 | 218 | ||
206 | static async getEmbedHTML () { | 219 | static async getEmbedHTML () { |