From ac0868bcc0259d4ff14265d9ae403e10869a13aa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jan 2020 14:17:57 +0100 Subject: Improve SQL query for my special playlists --- server/controllers/api/users/me.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'server/controllers/api/users') 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) 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) -- cgit v1.2.3