X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fvideos%2Fvideos.ts;h=469ea4d638cf9f3014114ade4f0b545b69674565;hb=bbb3be686ad960c5b1f34a7771dec09eb1783455;hp=a3a276188f89e7a6e8970cfa12800fe3190ec5f9;hpb=ea54cd04c1ff0e55651cd5fb1a83672acde68604;p=github%2FChocobozzz%2FPeerTube.git 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' import * as parseTorrent from 'parse-torrent' import { join } from 'path' import * as request from 'supertest' -import { v4 as uuidv4 } from 'uuid' import validator from 'validator' import { getLowercaseExtension } from '@server/helpers/core-utils' +import { buildUUID } from '@server/helpers/uuid' import { HttpStatusCode } from '@shared/core-utils' import { VideosCommonQuery } from '@shared/models' import { loadLanguages, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' @@ -806,7 +806,7 @@ async function uploadVideoAndGetId (options: { const res = await uploadVideo(options.server.url, options.token || options.server.accessToken, videoAttrs) - return { id: res.body.video.id, uuid: res.body.video.uuid } + return res.body.video as { id: number, uuid: string, shortUUID: string } } async function getLocalIdByUUID (url: string, uuid: string) { @@ -827,7 +827,7 @@ async function uploadRandomVideoOnServers (servers: ServerInfo[], serverNumber: async function uploadRandomVideo (server: ServerInfo, wait = true, additionalParams: any = {}) { const prefixName = additionalParams.prefixName || '' - const name = prefixName + uuidv4() + const name = prefixName + buildUUID() const data = Object.assign({ name }, additionalParams) const res = await uploadVideo(server.url, server.accessToken, data)