aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-03 14:17:57 +0100
committerChocobozzz <me@florianbigard.com>2020-01-03 14:17:57 +0100
commitac0868bcc0259d4ff14265d9ae403e10869a13aa (patch)
tree7a86bc8f4d881360d5b613dc906be1a0d99aa0df /server/controllers/api
parent35f28e94c763370616d25d5820f4b9ef70cedca9 (diff)
downloadPeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.tar.gz
PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.tar.zst
PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.zip
Improve SQL query for my special playlists
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/users/me.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index 2f3efe6aa..ac7c62aab 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -126,14 +126,13 @@ async function getUserVideoImports (req: express.Request, res: express.Response)
126 126
127async function getUserInformation (req: express.Request, res: express.Response) { 127async function getUserInformation (req: express.Request, res: express.Response) {
128 // We did not load channels in res.locals.user 128 // We did not load channels in res.locals.user
129 const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username) 129 const user = await UserModel.loadForMeAPI(res.locals.oauth.token.user.username)
130 130
131 return res.json(user.toFormattedJSON({ me: true })) 131 return res.json(user.toMeFormattedJSON())
132} 132}
133 133
134async function getUserVideoQuotaUsed (req: express.Request, res: express.Response) { 134async function getUserVideoQuotaUsed (req: express.Request, res: express.Response) {
135 // We did not load channels in res.locals.user 135 const user = res.locals.oauth.token.user
136 const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username)
137 const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user) 136 const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user)
138 const videoQuotaUsedDaily = await UserModel.getOriginalVideoFileTotalDailyFromUser(user) 137 const videoQuotaUsedDaily = await UserModel.getOriginalVideoFileTotalDailyFromUser(user)
139 138