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()
// 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)
licence: body.licence || importData.licence,
language: body.language || undefined,
commentsEnabled: body.commentsEnabled || true,
+ downloadEnabled: body.downloadEnabled || true,
waitTranscoding: body.waitTranscoding || false,
state: VideoState.TO_IMPORT,
nsfw: body.nsfw || importData.nsfw || false,