aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/import.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 14:32:44 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 15:12:22 +0200
commit41fb13c330de629df2d23379209e79c7af0f2e9a (patch)
tree73bc5a90566406b3910f142beae2a879c1e4265d /server/controllers/api/videos/import.ts
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip
esModuleInterop to true
Diffstat (limited to 'server/controllers/api/videos/import.ts')
-rw-r--r--server/controllers/api/videos/import.ts10
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 @@
1import * as express from 'express' 1import express from 'express'
2import { move, readFile } from 'fs-extra' 2import { move, readFile } from 'fs-extra'
3import * as magnetUtil from 'magnet-uri' 3import { decode } from 'magnet-uri'
4import * as parseTorrent from 'parse-torrent' 4import parseTorrent, { Instance } from 'parse-torrent'
5import { join } from 'path' 5import { join } from 'path'
6import { ServerConfigManager } from '@server/lib/server-config-manager' 6import { ServerConfigManager } from '@server/lib/server-config-manager'
7import { setVideoTags } from '@server/lib/video' 7import { 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
350function processMagnetURI (body: VideoImportCreate) { 350function 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),