diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-08 09:33:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-08 10:01:50 +0200 |
commit | ea54cd04c1ff0e55651cd5fb1a83672acde68604 (patch) | |
tree | 4e10fea658e72a9f79375d0e9b23d08915d3d0b2 /shared/extra-utils/videos | |
parent | 295106516277581ba4967199fa5580264a90ae2c (diff) | |
download | PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.gz PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.zst PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.zip |
Fix video upload with a capitalized ext
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/videos.ts | 5 |
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' | |||
4 | import { createReadStream, pathExists, readdir, readFile, stat } from 'fs-extra' | 4 | import { createReadStream, pathExists, readdir, readFile, stat } from 'fs-extra' |
5 | import got, { Response as GotResponse } from 'got/dist/source' | 5 | import got, { Response as GotResponse } from 'got/dist/source' |
6 | import * as parseTorrent from 'parse-torrent' | 6 | import * as parseTorrent from 'parse-torrent' |
7 | import { extname, join } from 'path' | 7 | import { join } from 'path' |
8 | import * as request from 'supertest' | 8 | import * as request from 'supertest' |
9 | import { v4 as uuidv4 } from 'uuid' | 9 | import { v4 as uuidv4 } from 'uuid' |
10 | import validator from 'validator' | 10 | import validator from 'validator' |
11 | import { getLowercaseExtension } from '@server/helpers/core-utils' | ||
11 | import { HttpStatusCode } from '@shared/core-utils' | 12 | import { HttpStatusCode } from '@shared/core-utils' |
12 | import { VideosCommonQuery } from '@shared/models' | 13 | import { VideosCommonQuery } from '@shared/models' |
13 | import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' | 14 | import { 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 | ||