mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Optimize SQL requests of watch page API endpoints
This commit is contained in:
parent
e972e046db
commit
627621c1e8
15 changed files with 68 additions and 60 deletions
|
@ -39,10 +39,8 @@ export class ClientHtml {
|
|||
let videoPromise: Bluebird<VideoModel>
|
||||
|
||||
// Let Angular application handle errors
|
||||
if (validator.isUUID(videoId, 4)) {
|
||||
videoPromise = VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(videoId)
|
||||
} else if (validator.isInt(videoId)) {
|
||||
videoPromise = VideoModel.loadAndPopulateAccountAndServerAndTags(+videoId)
|
||||
if (validator.isInt(videoId) || validator.isUUID(videoId, 4)) {
|
||||
videoPromise = VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
|
||||
} else {
|
||||
return ClientHtml.getIndexHTML(req, res)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue