From d23dd9fbfc4d26026352c10f81d2795ceaf2908a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Jul 2021 10:02:54 +0200 Subject: Introduce videos command --- server/tools/peertube-upload.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'server/tools/peertube-upload.ts') diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index c94b05857..597137e4c 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -4,7 +4,6 @@ registerTSPaths() import { program } from 'commander' import { access, constants } from 'fs-extra' import { isAbsolute } from 'path' -import { uploadVideo } from '../../shared/extra-utils/' import { assignToken, buildCommonVideoOptions, buildServer, buildVideoAttributesFromCommander, getServerCredentials } from './cli' let command = program @@ -52,16 +51,18 @@ async function run (url: string, username: string, password: string) { console.log('Uploading %s video...', options.videoName) - const videoAttributes = await buildVideoAttributesFromCommander(server, program) + const baseAttributes = await buildVideoAttributesFromCommander(server, program) + + const attributes = { + ...baseAttributes, - Object.assign(videoAttributes, { fixture: options.file, thumbnailfile: options.thumbnail, previewfile: options.preview - }) + } try { - await uploadVideo(url, server.accessToken, videoAttributes) + await server.videosCommand.upload({ attributes }) console.log(`Video ${options.videoName} uploaded.`) process.exit(0) } catch (err) { -- cgit v1.2.3