aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/client-html.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-18 12:00:49 +0200
committerChocobozzz <me@florianbigard.com>2018-09-19 09:54:37 +0200
commit627621c1e8d37c33f7b3dd59f4c8907b12c630bc (patch)
tree007e7118f482c543d3898b222b62c185fda4fd2b /server/lib/client-html.ts
parente972e046dbe9b499944c4fab9220eee13e31ac1b (diff)
downloadPeerTube-627621c1e8d37c33f7b3dd59f4c8907b12c630bc.tar.gz
PeerTube-627621c1e8d37c33f7b3dd59f4c8907b12c630bc.tar.zst
PeerTube-627621c1e8d37c33f7b3dd59f4c8907b12c630bc.zip
Optimize SQL requests of watch page API endpoints
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r--server/lib/client-html.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index b1088c096..fc013e0c3 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -39,10 +39,8 @@ export class ClientHtml {
39 let videoPromise: Bluebird<VideoModel> 39 let videoPromise: Bluebird<VideoModel>
40 40
41 // Let Angular application handle errors 41 // Let Angular application handle errors
42 if (validator.isUUID(videoId, 4)) { 42 if (validator.isInt(videoId) || validator.isUUID(videoId, 4)) {
43 videoPromise = VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(videoId) 43 videoPromise = VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
44 } else if (validator.isInt(videoId)) {
45 videoPromise = VideoModel.loadAndPopulateAccountAndServerAndTags(+videoId)
46 } else { 44 } else {
47 return ClientHtml.getIndexHTML(req, res) 45 return ClientHtml.getIndexHTML(req, res)
48 } 46 }