diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
commit | 62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch) | |
tree | c45c35d35d7a3e32621fba06edc63646930c8efd /server/tools/import-videos.ts | |
parent | 84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff) | |
download | PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.gz PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.zst PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.zip |
Correctly migrate to fs-extra
Diffstat (limited to 'server/tools/import-videos.ts')
-rw-r--r-- | server/tools/import-videos.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index e49fbb2f5..812600f8b 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts | |||
@@ -5,12 +5,12 @@ import * as program from 'commander' | |||
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import * as youtubeDL from 'youtube-dl' | 6 | import * as youtubeDL from 'youtube-dl' |
7 | import { VideoPrivacy } from '../../shared/models/videos' | 7 | import { VideoPrivacy } from '../../shared/models/videos' |
8 | import { unlinkPromise } from '../helpers/core-utils' | ||
9 | import { doRequestAndSaveToFile } from '../helpers/requests' | 8 | import { doRequestAndSaveToFile } from '../helpers/requests' |
10 | import { CONSTRAINTS_FIELDS } from '../initializers' | 9 | import { CONSTRAINTS_FIELDS } from '../initializers' |
11 | import { getClient, getVideoCategories, login, searchVideo, uploadVideo } from '../tests/utils' | 10 | import { getClient, getVideoCategories, login, searchVideo, uploadVideo } from '../tests/utils' |
12 | import { truncate } from 'lodash' | 11 | import { truncate } from 'lodash' |
13 | import * as prompt from 'prompt' | 12 | import * as prompt from 'prompt' |
13 | import { remove } from 'fs-extra' | ||
14 | 14 | ||
15 | program | 15 | program |
16 | .option('-u, --url <url>', 'Server url') | 16 | .option('-u, --url <url>', 'Server url') |
@@ -204,10 +204,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag | |||
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | await unlinkPromise(videoPath) | 207 | await remove(videoPath) |
208 | if (thumbnailfile) { | 208 | if (thumbnailfile) await remove(thumbnailfile) |
209 | await unlinkPromise(thumbnailfile) | ||
210 | } | ||
211 | 209 | ||
212 | console.log('Uploaded video "%s"!\n', videoAttributes.name) | 210 | console.log('Uploaded video "%s"!\n', videoAttributes.name) |
213 | } | 211 | } |