mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Add ability to order playlists
This commit is contained in:
parent
546bd42240
commit
0adafa0fc0
48 changed files with 1776 additions and 607 deletions
|
@ -1,3 +1,4 @@
|
|||
import { VideoPlaylistsListQuery } from '@peertube/peertube-models'
|
||||
import { pickCommonVideoQuery } from '@server/helpers/query.js'
|
||||
import { ActorFollowModel } from '@server/models/actor/actor-follow.js'
|
||||
import { getServerActor } from '@server/models/application/application.js'
|
||||
|
@ -182,6 +183,7 @@ async function listAccountChannelsSync (req: express.Request, res: express.Respo
|
|||
|
||||
async function listAccountPlaylists (req: express.Request, res: express.Response) {
|
||||
const serverActor = await getServerActor()
|
||||
const query = req.query as VideoPlaylistsListQuery
|
||||
|
||||
// Allow users to see their private/unlisted video playlists
|
||||
let listMyPlaylists = false
|
||||
|
@ -190,18 +192,19 @@ async function listAccountPlaylists (req: express.Request, res: express.Response
|
|||
}
|
||||
|
||||
const resultList = await VideoPlaylistModel.listForApi({
|
||||
search: req.query.search,
|
||||
|
||||
followerActorId: isUserAbleToSearchRemoteURI(res)
|
||||
? null
|
||||
: serverActor.id,
|
||||
|
||||
start: req.query.start,
|
||||
count: req.query.count,
|
||||
sort: req.query.sort,
|
||||
accountId: res.locals.account.id,
|
||||
listMyPlaylists,
|
||||
type: req.query.playlistType
|
||||
|
||||
start: query.start,
|
||||
count: query.count,
|
||||
sort: query.sort,
|
||||
search: query.search,
|
||||
|
||||
type: query.playlistType
|
||||
})
|
||||
|
||||
return res.json(getFormattedObjects(resultList.data, resultList.total))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue