diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-26 10:55:40 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-03-18 11:17:59 +0100 |
commit | 418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (patch) | |
tree | 5e9bc5604fd5d66a006cfebb7acdbdd5486e5d1e /shared/utils/videos/videos.ts | |
parent | b427febb4d5cebf03b815bca2c59af6e82491569 (diff) | |
download | PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.gz PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.zst PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.zip |
Playlist server API
Diffstat (limited to 'shared/utils/videos/videos.ts')
-rw-r--r-- | shared/utils/videos/videos.ts | 25 |
1 files changed, 24 insertions, 1 deletions
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 ( | |||
223 | }) | 223 | }) |
224 | } | 224 | } |
225 | 225 | ||
226 | function getPlaylistVideos ( | ||
227 | url: string, | ||
228 | accessToken: string, | ||
229 | playlistId: number | string, | ||
230 | start: number, | ||
231 | count: number, | ||
232 | query: { nsfw?: boolean } = {} | ||
233 | ) { | ||
234 | const path = '/api/v1/video-playlists/' + playlistId + '/videos' | ||
235 | |||
236 | return makeGetRequest({ | ||
237 | url, | ||
238 | path, | ||
239 | query: immutableAssign(query, { | ||
240 | start, | ||
241 | count | ||
242 | }), | ||
243 | token: accessToken, | ||
244 | statusCodeExpected: 200 | ||
245 | }) | ||
246 | } | ||
247 | |||
226 | function getVideosListPagination (url: string, start: number, count: number, sort?: string) { | 248 | function getVideosListPagination (url: string, start: number, count: number, sort?: string) { |
227 | const path = '/api/v1/videos' | 249 | const path = '/api/v1/videos' |
228 | 250 | ||
@@ -601,5 +623,6 @@ export { | |||
601 | parseTorrentVideo, | 623 | parseTorrentVideo, |
602 | getLocalVideos, | 624 | getLocalVideos, |
603 | completeVideoCheck, | 625 | completeVideoCheck, |
604 | checkVideoFilesWereRemoved | 626 | checkVideoFilesWereRemoved, |
627 | getPlaylistVideos | ||
605 | } | 628 | } |