From 14e2014acc1362cfbb770c051a7254b156cd8efb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Dec 2018 14:52:50 +0100 Subject: Support additional video extensions --- server/tests/api/videos/video-transcoder.ts | 31 +++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'server/tests/api/videos/video-transcoder.ts') 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) }) -- cgit v1.2.3