diff options
Diffstat (limited to 'server/controllers/api/videos/import.ts')
-rw-r--r-- | server/controllers/api/videos/import.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index de9a5308a..39fc57788 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import express from 'express' |
2 | import { move, readFile } from 'fs-extra' | 2 | import { move, readFile } from 'fs-extra' |
3 | import * as magnetUtil from 'magnet-uri' | 3 | import { decode } from 'magnet-uri' |
4 | import * as parseTorrent from 'parse-torrent' | 4 | import parseTorrent, { Instance } from 'parse-torrent' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 6 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
7 | import { setVideoTags } from '@server/lib/video' | 7 | import { setVideoTags } from '@server/lib/video' |
@@ -329,7 +329,7 @@ async function processTorrentOrAbortRequest (req: express.Request, res: express. | |||
329 | torrentfile.path = newTorrentPath | 329 | torrentfile.path = newTorrentPath |
330 | 330 | ||
331 | const buf = await readFile(torrentfile.path) | 331 | const buf = await readFile(torrentfile.path) |
332 | const parsedTorrent = parseTorrent(buf) as parseTorrent.Instance | 332 | const parsedTorrent = parseTorrent(buf) as Instance |
333 | 333 | ||
334 | if (parsedTorrent.files.length !== 1) { | 334 | if (parsedTorrent.files.length !== 1) { |
335 | cleanUpReqFiles(req) | 335 | cleanUpReqFiles(req) |
@@ -349,7 +349,7 @@ async function processTorrentOrAbortRequest (req: express.Request, res: express. | |||
349 | 349 | ||
350 | function processMagnetURI (body: VideoImportCreate) { | 350 | function processMagnetURI (body: VideoImportCreate) { |
351 | const magnetUri = body.magnetUri | 351 | const magnetUri = body.magnetUri |
352 | const parsed = magnetUtil.decode(magnetUri) | 352 | const parsed = decode(magnetUri) |
353 | 353 | ||
354 | return { | 354 | return { |
355 | name: extractNameFromArray(parsed.name), | 355 | name: extractNameFromArray(parsed.name), |