]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-transcoder.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-transcoder.ts
index 68cf001947a8c772028ca87cf6d2ef7b919ae1f2..eefd32ef81a34e0785a1b2709962542b3bacd1a6 100644 (file)
@@ -20,9 +20,8 @@ import {
   uploadVideo,
   webtorrentAdd
 } from '../../../../shared/utils'
-import { join } from 'path'
+import { extname, join } from 'path'
 import { waitJobs } from '../../../../shared/utils/server/jobs'
-import { pathExists } from 'fs-extra'
 import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants'
 
 const expect = chai.expect
@@ -322,6 +321,34 @@ describe('Test video transcoding', function () {
     }
   })
 
+  it('Should accept and transcode additional extensions', async function () {
+    this.timeout(300000)
+
+    for (const fixture of [ 'video_short.mkv', 'video_short.avi' ]) {
+      const videoAttributes = {
+        name: fixture,
+        fixture
+      }
+
+      await uploadVideo(servers[ 1 ].url, servers[ 1 ].accessToken, videoAttributes)
+
+      await waitJobs(servers)
+
+      for (const server of servers) {
+        const res = await getVideosList(server.url)
+
+        const video = res.body.data.find(v => v.name === videoAttributes.name)
+        const res2 = await getVideo(server.url, video.id)
+        const videoDetails = res2.body
+
+        expect(videoDetails.files).to.have.lengthOf(4)
+
+        const magnetUri = videoDetails.files[ 0 ].magnetUri
+        expect(magnetUri).to.contain('.mp4')
+      }
+    }
+  })
+
   after(async function () {
     killallServers(servers)
   })