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:
parent
35f28e94c7
commit
ac0868bcc0
5 changed files with 64 additions and 43 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue