1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Improve SQL query for my special playlists

This commit is contained in:
Chocobozzz 2020-01-03 14:17:57 +01:00
parent 35f28e94c7
commit ac0868bcc0
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 64 additions and 43 deletions

View file

@ -126,14 +126,13 @@ async function getUserVideoImports (req: express.Request, res: express.Response)
async function getUserInformation (req: express.Request, res: express.Response) {
// We did not load channels in res.locals.user
const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username)
const user = await UserModel.loadForMeAPI(res.locals.oauth.token.user.username)
return res.json(user.toFormattedJSON({ me: true }))
return res.json(user.toMeFormattedJSON())
}
async function getUserVideoQuotaUsed (req: express.Request, res: express.Response) {
// We did not load channels in res.locals.user
const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username)
const user = res.locals.oauth.token.user
const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user)
const videoQuotaUsedDaily = await UserModel.getOriginalVideoFileTotalDailyFromUser(user)