From d23dd9fbfc4d26026352c10f81d2795ceaf2908a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Jul 2021 10:02:54 +0200 Subject: Introduce videos command --- scripts/benchmark.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 272f9e8b1..d9e4a08ab 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -1,6 +1,6 @@ import * as autocannon from 'autocannon' import { writeJson } from 'fs-extra' -import { flushAndRunServer, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '@shared/extra-utils' +import { flushAndRunServer, killallServers, ServerInfo, setAccessTokensToServers } from '@shared/extra-utils' import { Video, VideoPrivacy } from '@shared/models' import { registerTSPaths } from '../server/helpers/register-ts-paths' @@ -197,7 +197,7 @@ async function prepare () { }) await setAccessTokensToServers([ server ]) - const videoAttributes = { + const attributes = { name: 'my super video', category: 2, nsfw: true, @@ -210,12 +210,11 @@ async function prepare () { } for (let i = 0; i < 10; i++) { - Object.assign(videoAttributes, { name: 'my super video ' + i }) - await uploadVideo(server.url, server.accessToken, videoAttributes) + await server.videosCommand.upload({ attributes: { ...attributes, name: 'my super video ' + i } }) } - const resVideos = await getVideosList(server.url) - video = resVideos.body.data.find(v => v.name === 'my super video 1') + const { data } = await server.videosCommand.list() + video = data.find(v => v.name === 'my super video 1') for (let i = 0; i < 10; i++) { const text = 'my super first comment' -- cgit v1.2.3