aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-08 09:33:03 +0200
committerChocobozzz <me@florianbigard.com>2021-06-08 10:01:50 +0200
commitea54cd04c1ff0e55651cd5fb1a83672acde68604 (patch)
tree4e10fea658e72a9f79375d0e9b23d08915d3d0b2 /shared/extra-utils
parent295106516277581ba4967199fa5580264a90ae2c (diff)
downloadPeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.gz
PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.zst
PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.zip
Fix video upload with a capitalized ext
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/videos/videos.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index 98a568a02..a3a276188 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -4,10 +4,11 @@ import { expect } from 'chai'
4import { createReadStream, pathExists, readdir, readFile, stat } from 'fs-extra' 4import { createReadStream, pathExists, readdir, readFile, stat } from 'fs-extra'
5import got, { Response as GotResponse } from 'got/dist/source' 5import got, { Response as GotResponse } from 'got/dist/source'
6import * as parseTorrent from 'parse-torrent' 6import * as parseTorrent from 'parse-torrent'
7import { extname, join } from 'path' 7import { join } from 'path'
8import * as request from 'supertest' 8import * as request from 'supertest'
9import { v4 as uuidv4 } from 'uuid' 9import { v4 as uuidv4 } from 'uuid'
10import validator from 'validator' 10import validator from 'validator'
11import { getLowercaseExtension } from '@server/helpers/core-utils'
11import { HttpStatusCode } from '@shared/core-utils' 12import { HttpStatusCode } from '@shared/core-utils'
12import { VideosCommonQuery } from '@shared/models' 13import { VideosCommonQuery } from '@shared/models'
13import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' 14import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants'
@@ -738,7 +739,7 @@ async function completeVideoCheck (
738 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution) 739 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)
739 expect(file).not.to.be.undefined 740 expect(file).not.to.be.undefined
740 741
741 let extension = extname(attributes.fixture) 742 let extension = getLowercaseExtension(attributes.fixture)
742 // Transcoding enabled: extension will always be .mp4 743 // Transcoding enabled: extension will always be .mp4
743 if (attributes.files.length > 1) extension = '.mp4' 744 if (attributes.files.length > 1) extension = '.mp4'
744 745