X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fvideos%2Fvideo-playlists.ts;h=6762c59736596275560616aaaf833c92decbeea9;hb=822c7e610d19e3320519a6ae5c90c01db971f03f;hp=4d110a13124cebd1bd47ae286788a7d66cf3e013;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/videos/video-playlists.ts b/shared/extra-utils/videos/video-playlists.ts index 4d110a131..6762c5973 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({ @@ -196,11 +197,11 @@ function updateVideoPlaylistElement (options: { url: string, token: string, playlistId: number | string, - videoId: 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, @@ -215,10 +216,10 @@ function removeVideoFromPlaylist (options: { url: string, token: string, playlistId: number | string, - videoId: 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, @@ -252,10 +253,10 @@ function reorderVideosPlaylist (options: { async function checkPlaylistFilesWereRemoved ( playlistUUID: string, - serverNumber: number, + internalServerNumber: number, directories = [ 'thumbnails' ] ) { - const testDirectory = 'test' + serverNumber + const testDirectory = 'test' + internalServerNumber for (const directory of directories) { const directoryPath = join(root(), testDirectory, directory)