diff options
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/videos.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts index a3a276188..469ea4d63 100644 --- a/shared/extra-utils/videos/videos.ts +++ b/shared/extra-utils/videos/videos.ts | |||
@@ -6,9 +6,9 @@ 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 { 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' | ||
10 | import validator from 'validator' | 9 | import validator from 'validator' |
11 | import { getLowercaseExtension } from '@server/helpers/core-utils' | 10 | import { getLowercaseExtension } from '@server/helpers/core-utils' |
11 | import { buildUUID } from '@server/helpers/uuid' | ||
12 | import { HttpStatusCode } from '@shared/core-utils' | 12 | import { HttpStatusCode } from '@shared/core-utils' |
13 | import { VideosCommonQuery } from '@shared/models' | 13 | import { VideosCommonQuery } from '@shared/models' |
14 | 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' |
@@ -806,7 +806,7 @@ async function uploadVideoAndGetId (options: { | |||
806 | 806 | ||
807 | const res = await uploadVideo(options.server.url, options.token || options.server.accessToken, videoAttrs) | 807 | const res = await uploadVideo(options.server.url, options.token || options.server.accessToken, videoAttrs) |
808 | 808 | ||
809 | return { id: res.body.video.id, uuid: res.body.video.uuid } | 809 | return res.body.video as { id: number, uuid: string, shortUUID: string } |
810 | } | 810 | } |
811 | 811 | ||
812 | async function getLocalIdByUUID (url: string, uuid: string) { | 812 | async function getLocalIdByUUID (url: string, uuid: string) { |
@@ -827,7 +827,7 @@ async function uploadRandomVideoOnServers (servers: ServerInfo[], serverNumber: | |||
827 | 827 | ||
828 | async function uploadRandomVideo (server: ServerInfo, wait = true, additionalParams: any = {}) { | 828 | async function uploadRandomVideo (server: ServerInfo, wait = true, additionalParams: any = {}) { |
829 | const prefixName = additionalParams.prefixName || '' | 829 | const prefixName = additionalParams.prefixName || '' |
830 | const name = prefixName + uuidv4() | 830 | const name = prefixName + buildUUID() |
831 | 831 | ||
832 | const data = Object.assign({ name }, additionalParams) | 832 | const data = Object.assign({ name }, additionalParams) |
833 | const res = await uploadVideo(server.url, server.accessToken, data) | 833 | const res = await uploadVideo(server.url, server.accessToken, data) |