aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-09 09:26:59 +0100
committerChocobozzz <me@florianbigard.com>2020-01-09 09:27:21 +0100
commit6b0c3c7ca917ad09a011c2821f5bd1a2485aebca (patch)
treea660791ddc78c95fe69469bd7c33e0e719fba871 /server/controllers
parent119b16e5acffff1901f23c7a0188c78272453e7d (diff)
downloadPeerTube-6b0c3c7ca917ad09a011c2821f5bd1a2485aebca.tar.gz
PeerTube-6b0c3c7ca917ad09a011c2821f5bd1a2485aebca.tar.zst
PeerTube-6b0c3c7ca917ad09a011c2821f5bd1a2485aebca.zip
Optimize list my playlists SQL query
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/accounts.ts6
1 files changed, 3 insertions, 3 deletions
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
133 const serverActor = await getServerActor() 133 const serverActor = await getServerActor()
134 134
135 // Allow users to see their private/unlisted video playlists 135 // Allow users to see their private/unlisted video playlists
136 let privateAndUnlisted = false 136 let listMyPlaylists = false
137 if (res.locals.oauth && res.locals.oauth.token.User.Account.id === res.locals.account.id) { 137 if (res.locals.oauth && res.locals.oauth.token.User.Account.id === res.locals.account.id) {
138 privateAndUnlisted = true 138 listMyPlaylists = true
139 } 139 }
140 140
141 const resultList = await VideoPlaylistModel.listForApi({ 141 const resultList = await VideoPlaylistModel.listForApi({
@@ -145,7 +145,7 @@ async function listAccountPlaylists (req: express.Request, res: express.Response
145 count: req.query.count, 145 count: req.query.count,
146 sort: req.query.sort, 146 sort: req.query.sort,
147 accountId: res.locals.account.id, 147 accountId: res.locals.account.id,
148 privateAndUnlisted, 148 listMyPlaylists,
149 type: req.query.playlistType 149 type: req.query.playlistType
150 }) 150 })
151 151