From 418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 26 Feb 2019 10:55:40 +0100 Subject: Playlist server API --- shared/utils/videos/videos.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'shared/utils/videos/videos.ts') 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 } -- cgit v1.2.3