X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Futils%2Fvideos%2Fvideos.ts;h=2c09f008604556cdc226a79f37047b4f33fe9545;hb=418d092afa81e2c8fe8ac6838fc4b5eb0af6a782;hp=b3d24bc53dd136389c43b3ccbe124f43e920fd56;hpb=7f40ce53243be994a3cf093e07eb1d460f696b10;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/utils/videos/videos.ts b/shared/utils/videos/videos.ts index b3d24bc53..2c09f0086 100644 --- a/shared/utils/videos/videos.ts +++ b/shared/utils/videos/videos.ts @@ -223,6 +223,28 @@ function getVideoChannelVideos ( }) } +function getPlaylistVideos ( + url: string, + accessToken: string, + playlistId: number | string, + start: number, + count: number, + query: { nsfw?: boolean } = {} +) { + const path = '/api/v1/video-playlists/' + playlistId + '/videos' + + return makeGetRequest({ + url, + path, + query: immutableAssign(query, { + start, + count + }), + token: accessToken, + statusCodeExpected: 200 + }) +} + function getVideosListPagination (url: string, start: number, count: number, sort?: string) { const path = '/api/v1/videos' @@ -601,5 +623,6 @@ export { parseTorrentVideo, getLocalVideos, completeVideoCheck, - checkVideoFilesWereRemoved + checkVideoFilesWereRemoved, + getPlaylistVideos }