From f481c4f9f31e897a08e818f388fecdee07f57142 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Dec 2018 15:12:38 +0100 Subject: Use move instead rename To avoid EXDEV errors --- server/controllers/api/videos/import.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/controllers/api') 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' import * as Bluebird from 'bluebird' import * as parseTorrent from 'parse-torrent' import { getSecureTorrentName } from '../../../helpers/utils' -import { readFile, rename } from 'fs-extra' +import { readFile, move } from 'fs-extra' const auditLogger = auditLoggerFactory('video-imports') const videoImportsRouter = express.Router() @@ -71,7 +71,7 @@ async function addTorrentImport (req: express.Request, res: express.Response, to // Rename the torrent to a secured name const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, getSecureTorrentName(torrentName)) - await rename(torrentfile.path, newTorrentPath) + await move(torrentfile.path, newTorrentPath) torrentfile.path = newTorrentPath const buf = await readFile(torrentfile.path) -- cgit v1.2.3