aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools')
-rw-r--r--server/tools/peertube-redundancy.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.ts
index 1ab58a438..fe482daf4 100644
--- a/server/tools/peertube-redundancy.ts
+++ b/server/tools/peertube-redundancy.ts
@@ -7,6 +7,7 @@ import * as program from 'commander'
7import { getAdminTokenOrDie, getServerCredentials } from './cli' 7import { getAdminTokenOrDie, getServerCredentials } from './cli'
8import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' 8import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models'
9import { addVideoRedundancy, listVideoRedundancies, removeVideoRedundancy } from '@shared/extra-utils/server/redundancy' 9import { addVideoRedundancy, listVideoRedundancies, removeVideoRedundancy } from '@shared/extra-utils/server/redundancy'
10import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
10import validator from 'validator' 11import validator from 'validator'
11import * as CliTable3 from 'cli-table3' 12import * as CliTable3 from 'cli-table3'
12import { URL } from 'url' 13import { URL } from 'url'
@@ -124,9 +125,9 @@ async function addRedundancyCLI (options: { videoId: number }) {
124 125
125 process.exit(0) 126 process.exit(0)
126 } catch (err) { 127 } catch (err) {
127 if (err.message.includes(409)) { 128 if (err.message.includes(HttpStatusCode.CONFLICT_409)) {
128 console.error('This video is already duplicated by your instance.') 129 console.error('This video is already duplicated by your instance.')
129 } else if (err.message.includes(404)) { 130 } else if (err.message.includes(HttpStatusCode.NOT_FOUND_404)) {
130 console.error('This video id does not exist.') 131 console.error('This video id does not exist.')
131 } else { 132 } else {
132 console.error(err) 133 console.error(err)