diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:04:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 89d241a79c262b9775c233b73cff080043ebb5e6 (patch) | |
tree | cb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tools/peertube-redundancy.ts | |
parent | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff) | |
download | PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip |
Shorter server command names
Diffstat (limited to 'server/tools/peertube-redundancy.ts')
-rw-r--r-- | server/tools/peertube-redundancy.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.ts index 0f6b3086c..5fda68c8e 100644 --- a/server/tools/peertube-redundancy.ts +++ b/server/tools/peertube-redundancy.ts | |||
@@ -63,7 +63,7 @@ async function listRedundanciesCLI (target: VideoRedundanciesTarget) { | |||
63 | const server = buildServer(url) | 63 | const server = buildServer(url) |
64 | await assignToken(server, username, password) | 64 | await assignToken(server, username, password) |
65 | 65 | ||
66 | const { data } = await server.redundancyCommand.listVideos({ start: 0, count: 100, sort: 'name', target }) | 66 | const { data } = await server.redundancy.listVideos({ start: 0, count: 100, sort: 'name', target }) |
67 | 67 | ||
68 | const table = new CliTable3({ | 68 | const table = new CliTable3({ |
69 | head: [ 'video id', 'video name', 'video url', 'files', 'playlists', 'by instances', 'total size' ] | 69 | head: [ 'video id', 'video name', 'video url', 'files', 'playlists', 'by instances', 'total size' ] |
@@ -114,7 +114,7 @@ async function addRedundancyCLI (options: { video: number }, command: Command) { | |||
114 | } | 114 | } |
115 | 115 | ||
116 | try { | 116 | try { |
117 | await server.redundancyCommand.addVideo({ videoId: options.video }) | 117 | await server.redundancy.addVideo({ videoId: options.video }) |
118 | 118 | ||
119 | console.log('Video will be duplicated by your instance!') | 119 | console.log('Video will be duplicated by your instance!') |
120 | 120 | ||
@@ -145,11 +145,11 @@ async function removeRedundancyCLI (options: { video: number }, command: Command | |||
145 | 145 | ||
146 | const videoId = parseInt(options.video + '', 10) | 146 | const videoId = parseInt(options.video + '', 10) |
147 | 147 | ||
148 | const myVideoRedundancies = await server.redundancyCommand.listVideos({ target: 'my-videos' }) | 148 | const myVideoRedundancies = await server.redundancy.listVideos({ target: 'my-videos' }) |
149 | let videoRedundancy = myVideoRedundancies.data.find(r => videoId === r.id) | 149 | let videoRedundancy = myVideoRedundancies.data.find(r => videoId === r.id) |
150 | 150 | ||
151 | if (!videoRedundancy) { | 151 | if (!videoRedundancy) { |
152 | const remoteVideoRedundancies = await server.redundancyCommand.listVideos({ target: 'remote-videos' }) | 152 | const remoteVideoRedundancies = await server.redundancy.listVideos({ target: 'remote-videos' }) |
153 | videoRedundancy = remoteVideoRedundancies.data.find(r => videoId === r.id) | 153 | videoRedundancy = remoteVideoRedundancies.data.find(r => videoId === r.id) |
154 | } | 154 | } |
155 | 155 | ||
@@ -164,7 +164,7 @@ async function removeRedundancyCLI (options: { video: number }, command: Command | |||
164 | .map(r => r.id) | 164 | .map(r => r.id) |
165 | 165 | ||
166 | for (const id of ids) { | 166 | for (const id of ids) { |
167 | await server.redundancyCommand.removeVideo({ redundancyId: id }) | 167 | await server.redundancy.removeVideo({ redundancyId: id }) |
168 | } | 168 | } |
169 | 169 | ||
170 | console.log('Video redundancy removed!') | 170 | console.log('Video redundancy removed!') |