X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fvideos%2Fvideo-playlists.ts;h=5bcc02570984d2e211769140f3ff864f9d5ae8cc;hb=818c449b3c34e9f324ac744120c8774e724ab25e;hp=fd62bef1999e93747e2a598cbb1b4cdc06294776;hpb=1600235a2f4e30c5d4e7d4342d1c299845decc60;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/videos/video-playlists.ts b/shared/extra-utils/videos/video-playlists.ts index fd62bef19..5bcc02570 100644 --- a/shared/extra-utils/videos/video-playlists.ts +++ b/shared/extra-utils/videos/video-playlists.ts @@ -45,13 +45,14 @@ function getVideoChannelPlaylistsList (url: string, videoChannelName: string, st }) } -function getAccountPlaylistsList (url: string, accountName: string, start: number, count: number, sort?: string) { +function getAccountPlaylistsList (url: string, accountName: string, start: number, count: number, sort?: string, search?: string) { const path = '/api/v1/accounts/' + accountName + '/video-playlists' const query = { start, count, - sort + sort, + search } return makeGetRequest({ @@ -122,9 +123,9 @@ function deleteVideoPlaylist (url: string, token: string, playlistId: number | s } function createVideoPlaylist (options: { - url: string, - token: string, - playlistAttrs: VideoPlaylistCreate, + url: string + token: string + playlistAttrs: VideoPlaylistCreate expectedStatus?: number }) { const path = '/api/v1/video-playlists' @@ -147,10 +148,10 @@ function createVideoPlaylist (options: { } function updateVideoPlaylist (options: { - url: string, - token: string, - playlistAttrs: VideoPlaylistUpdate, - playlistId: number | string, + url: string + token: string + playlistAttrs: VideoPlaylistUpdate + playlistId: number | string expectedStatus?: number }) { const path = '/api/v1/video-playlists/' + options.playlistId @@ -173,9 +174,9 @@ function updateVideoPlaylist (options: { } async function addVideoInPlaylist (options: { - url: string, - token: string, - playlistId: number | string, + url: string + token: string + playlistId: number | string elementAttrs: VideoPlaylistElementCreate | { videoId: string } expectedStatus?: number }) { @@ -193,14 +194,14 @@ async function addVideoInPlaylist (options: { } function updateVideoPlaylistElement (options: { - url: string, - token: string, - playlistId: number | string, - videoId: number | string, - elementAttrs: VideoPlaylistElementUpdate, + url: string + token: string + playlistId: number | string + playlistElementId: number | string + elementAttrs: VideoPlaylistElementUpdate expectedStatus?: number }) { - const path = '/api/v1/video-playlists/' + options.playlistId + '/videos/' + options.videoId + const path = '/api/v1/video-playlists/' + options.playlistId + '/videos/' + options.playlistElementId return makePutBodyRequest({ url: options.url, @@ -212,13 +213,13 @@ function updateVideoPlaylistElement (options: { } function removeVideoFromPlaylist (options: { - url: string, - token: string, - playlistId: number | string, - videoId: number | string, + url: string + token: string + playlistId: number | string + playlistElementId: number expectedStatus?: number }) { - const path = '/api/v1/video-playlists/' + options.playlistId + '/videos/' + options.videoId + const path = '/api/v1/video-playlists/' + options.playlistId + '/videos/' + options.playlistElementId return makeDeleteRequest({ url: options.url, @@ -229,14 +230,14 @@ function removeVideoFromPlaylist (options: { } function reorderVideosPlaylist (options: { - url: string, - token: string, - playlistId: number | string, + url: string + token: string + playlistId: number | string elementAttrs: { - startPosition: number, - insertAfterPosition: number, + startPosition: number + insertAfterPosition: number reorderLength?: number - }, + } expectedStatus?: number }) { const path = '/api/v1/video-playlists/' + options.playlistId + '/videos/reorder'