]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/videos/video-playlists.ts
Fix playlist search
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / videos / video-playlists.ts
index 4d110a13124cebd1bd47ae286788a7d66cf3e013..6762c59736596275560616aaaf833c92decbeea9 100644 (file)
@@ -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)