aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/webtorrent.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/webtorrent.ts')
-rw-r--r--server/helpers/webtorrent.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts
index 14dfe0d28..d2a22e8f0 100644
--- a/server/helpers/webtorrent.ts
+++ b/server/helpers/webtorrent.ts
@@ -4,6 +4,8 @@ import * as WebTorrent from 'webtorrent'
4import { createWriteStream, ensureDir, remove } from 'fs-extra' 4import { createWriteStream, ensureDir, remove } from 'fs-extra'
5import { CONFIG } from '../initializers/config' 5import { CONFIG } from '../initializers/config'
6import { dirname, join } from 'path' 6import { dirname, join } from 'path'
7import * as createTorrent from 'create-torrent'
8import { promisify2 } from './core-utils'
7 9
8async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName?: string }, timeout: number) { 10async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName?: string }, timeout: number) {
9 const id = target.magnetUri || target.torrentName 11 const id = target.magnetUri || target.torrentName
@@ -57,9 +59,12 @@ async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName
57 }) 59 })
58} 60}
59 61
62const createTorrentPromise = promisify2<string, any, any>(createTorrent)
63
60// --------------------------------------------------------------------------- 64// ---------------------------------------------------------------------------
61 65
62export { 66export {
67 createTorrentPromise,
63 downloadWebTorrentVideo 68 downloadWebTorrentVideo
64} 69}
65 70