diff options
Diffstat (limited to 'server/tools')
-rw-r--r-- | server/tools/cli.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-plugins.ts | 2 | ||||
-rw-r--r-- | server/tools/peertube-redundancy.ts | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/server/tools/cli.ts b/server/tools/cli.ts index a15d73fb4..4607d052a 100644 --- a/server/tools/cli.ts +++ b/server/tools/cli.ts | |||
@@ -20,7 +20,7 @@ async function getAdminTokenOrDie (server: PeerTubeServer, username: string, pas | |||
20 | const token = await server.login.getAccessToken(username, password) | 20 | const token = await server.login.getAccessToken(username, password) |
21 | const me = await server.users.getMyInfo({ token }) | 21 | const me = await server.users.getMyInfo({ token }) |
22 | 22 | ||
23 | if (me.role !== UserRole.ADMINISTRATOR) { | 23 | if (me.role.id !== UserRole.ADMINISTRATOR) { |
24 | console.error('You must be an administrator.') | 24 | console.error('You must be an administrator.') |
25 | process.exit(-1) | 25 | process.exit(-1) |
26 | } | 26 | } |
diff --git a/server/tools/peertube-plugins.ts b/server/tools/peertube-plugins.ts index 47090b3a5..c51d9ebd1 100644 --- a/server/tools/peertube-plugins.ts +++ b/server/tools/peertube-plugins.ts | |||
@@ -69,7 +69,7 @@ async function pluginsListCLI (command: Command, options: OptionValues) { | |||
69 | 69 | ||
70 | const table = new CliTable3({ | 70 | const table = new CliTable3({ |
71 | head: [ 'name', 'version', 'homepage' ], | 71 | head: [ 'name', 'version', 'homepage' ], |
72 | colWidths: [ 50, 10, 50 ] | 72 | colWidths: [ 50, 20, 50 ] |
73 | }) as any | 73 | }) as any |
74 | 74 | ||
75 | for (const plugin of data) { | 75 | for (const plugin of data) { |
diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.ts index 4bb9fbc5a..5c82fa420 100644 --- a/server/tools/peertube-redundancy.ts +++ b/server/tools/peertube-redundancy.ts | |||
@@ -2,7 +2,7 @@ import CliTable3 from 'cli-table3' | |||
2 | import { Command, program } from 'commander' | 2 | import { Command, program } from 'commander' |
3 | import { URL } from 'url' | 3 | import { URL } from 'url' |
4 | import validator from 'validator' | 4 | import validator from 'validator' |
5 | import { uniqify } from '@shared/core-utils' | 5 | import { forceNumber, uniqify } from '@shared/core-utils' |
6 | import { HttpStatusCode, VideoRedundanciesTarget } from '@shared/models' | 6 | import { HttpStatusCode, VideoRedundanciesTarget } from '@shared/models' |
7 | import { assignToken, buildServer, getServerCredentials } from './cli' | 7 | import { assignToken, buildServer, getServerCredentials } from './cli' |
8 | 8 | ||
@@ -138,7 +138,7 @@ async function removeRedundancyCLI (options: { video: number }, command: Command | |||
138 | process.exit(-1) | 138 | process.exit(-1) |
139 | } | 139 | } |
140 | 140 | ||
141 | const videoId = parseInt(options.video + '', 10) | 141 | const videoId = forceNumber(options.video) |
142 | 142 | ||
143 | const myVideoRedundancies = await server.redundancy.listVideos({ target: 'my-videos' }) | 143 | const myVideoRedundancies = await server.redundancy.listVideos({ target: 'my-videos' }) |
144 | let videoRedundancy = myVideoRedundancies.data.find(r => videoId === r.id) | 144 | let videoRedundancy = myVideoRedundancies.data.find(r => videoId === r.id) |