X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-transcoder.ts;h=eefd32ef81a34e0785a1b2709962542b3bacd1a6;hb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;hp=68cf001947a8c772028ca87cf6d2ef7b919ae1f2;hpb=2a8c5d0af13f3ccb9a505e1fbc9d324b9d33ba1f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index 68cf00194..eefd32ef8 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts @@ -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) })