]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/videos.ts
Change how we handle resolution
[github/Chocobozzz/PeerTube.git] / server / tests / utils / videos.ts
index 7f8bd39c094d2be5b61372fc3a3d80afc98f6228..2a9a236ca50259f9b550ba4a21680cb04cb601e0 100644 (file)
@@ -196,14 +196,14 @@ function uploadVideo (url: string, accessToken: string, videoAttributesArg: Vide
     req.field('tags[' + i + ']', attributes.tags[i])
   }
 
-  let filepath = ''
+  let filePath = ''
   if (isAbsolute(attributes.fixture)) {
-    filepath = attributes.fixture
+    filePath = attributes.fixture
   } else {
-    filepath = join(__dirname, '..', 'api', 'fixtures', attributes.fixture)
+    filePath = join(__dirname, '..', 'api', 'fixtures', attributes.fixture)
   }
 
-  return req.attach('videofile', filepath)
+  return req.attach('videofile', filePath)
             .expect(specialStatus)
 }
 
@@ -238,9 +238,9 @@ function rateVideo (url: string, accessToken: string, id: number, rating: string
           .expect(specialStatus)
 }
 
-function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolutionLabel: string) {
+function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolution: number) {
   return new Promise<any>((res, rej) => {
-    const torrentName = videoUUID + '-' + resolutionLabel + '.torrent'
+    const torrentName = videoUUID + '-' + resolution + '.torrent'
     const torrentPath = join(__dirname, '..', '..', '..', 'test' + server.serverNumber, 'torrents', torrentName)
     readFile(torrentPath, (err, data) => {
       if (err) return rej(err)