diff options
Diffstat (limited to 'server/controllers/api/videos/import.ts')
-rw-r--r-- | server/controllers/api/videos/import.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 099ab7b8d..98366cd82 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -21,7 +21,7 @@ import { VideoChannelModel } from '../../../models/video/video-channel' | |||
21 | import * as Bluebird from 'bluebird' | 21 | import * as Bluebird from 'bluebird' |
22 | import * as parseTorrent from 'parse-torrent' | 22 | import * as parseTorrent from 'parse-torrent' |
23 | import { getSecureTorrentName } from '../../../helpers/utils' | 23 | import { getSecureTorrentName } from '../../../helpers/utils' |
24 | import { readFile, rename } from 'fs-extra' | 24 | import { readFile, move } from 'fs-extra' |
25 | 25 | ||
26 | const auditLogger = auditLoggerFactory('video-imports') | 26 | const auditLogger = auditLoggerFactory('video-imports') |
27 | const videoImportsRouter = express.Router() | 27 | const videoImportsRouter = express.Router() |
@@ -71,7 +71,7 @@ async function addTorrentImport (req: express.Request, res: express.Response, to | |||
71 | 71 | ||
72 | // Rename the torrent to a secured name | 72 | // Rename the torrent to a secured name |
73 | const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, getSecureTorrentName(torrentName)) | 73 | const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, getSecureTorrentName(torrentName)) |
74 | await rename(torrentfile.path, newTorrentPath) | 74 | await move(torrentfile.path, newTorrentPath) |
75 | torrentfile.path = newTorrentPath | 75 | torrentfile.path = newTorrentPath |
76 | 76 | ||
77 | const buf = await readFile(torrentfile.path) | 77 | const buf = await readFile(torrentfile.path) |