]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/shared/videos.ts
add filter:api.video-playlist.videos.list.* hooks
[github/Chocobozzz/PeerTube.git] / server / tests / shared / videos.ts
index 6be094f2bfcea4f21311f31976da7382ef9874dc..989865a4906f74887f2b411240e1caeeac9205c9 100644 (file)
@@ -240,6 +240,16 @@ async function uploadRandomVideoOnServers (
   return res
 }
 
+function getAllFiles (video: VideoDetails) {
+  const files = video.files
+
+  if (video.streamingPlaylists[0]) {
+    return files.concat(video.streamingPlaylists[0].files)
+  }
+
+  return files
+}
+
 // ---------------------------------------------------------------------------
 
 export {
@@ -247,5 +257,6 @@ export {
   checkUploadVideoParam,
   uploadRandomVideoOnServers,
   checkVideoFilesWereRemoved,
-  saveVideoInServers
+  saveVideoInServers,
+  getAllFiles
 }