X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-redundancy.ts;h=fd6c760b23de6fb212047b22d72076a5468a20da;hb=4cf800a350972a078c074da6b31da2b98ab4b007;hp=4bb9fbc5a414e0ca00d80b57e0c7955abd31d781;hpb=690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.ts index 4bb9fbc5a..fd6c760b2 100644 --- a/server/tools/peertube-redundancy.ts +++ b/server/tools/peertube-redundancy.ts @@ -2,9 +2,9 @@ import CliTable3 from 'cli-table3' import { Command, program } from 'commander' import { URL } from 'url' import validator from 'validator' -import { uniqify } from '@shared/core-utils' +import { forceNumber, uniqify } from '@shared/core-utils' import { HttpStatusCode, VideoRedundanciesTarget } from '@shared/models' -import { assignToken, buildServer, getServerCredentials } from './cli' +import { assignToken, buildServer, getServerCredentials } from './shared' import bytes = require('bytes') program @@ -138,7 +138,7 @@ async function removeRedundancyCLI (options: { video: number }, command: Command process.exit(-1) } - const videoId = parseInt(options.video + '', 10) + const videoId = forceNumber(options.video) const myVideoRedundancies = await server.redundancy.listVideos({ target: 'my-videos' }) let videoRedundancy = myVideoRedundancies.data.find(r => videoId === r.id)