From 6b0c3c7ca917ad09a011c2821f5bd1a2485aebca Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Jan 2020 09:26:59 +0100 Subject: Optimize list my playlists SQL query --- server/controllers/api/accounts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts index 00148ff55..05740318e 100644 --- a/server/controllers/api/accounts.ts +++ b/server/controllers/api/accounts.ts @@ -133,9 +133,9 @@ async function listAccountPlaylists (req: express.Request, res: express.Response const serverActor = await getServerActor() // Allow users to see their private/unlisted video playlists - let privateAndUnlisted = false + let listMyPlaylists = false if (res.locals.oauth && res.locals.oauth.token.User.Account.id === res.locals.account.id) { - privateAndUnlisted = true + listMyPlaylists = true } const resultList = await VideoPlaylistModel.listForApi({ @@ -145,7 +145,7 @@ async function listAccountPlaylists (req: express.Request, res: express.Response count: req.query.count, sort: req.query.sort, accountId: res.locals.account.id, - privateAndUnlisted, + listMyPlaylists, type: req.query.playlistType }) -- cgit v1.2.3