mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Optimize list my playlists SQL query
This commit is contained in:
parent
119b16e5ac
commit
6b0c3c7ca9
3 changed files with 36 additions and 23 deletions
|
@ -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
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue