diff options
Diffstat (limited to 'server/helpers/webtorrent.ts')
-rw-r--r-- | server/helpers/webtorrent.ts | 5 |
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' | |||
4 | import { createWriteStream, ensureDir, remove } from 'fs-extra' | 4 | import { createWriteStream, ensureDir, remove } from 'fs-extra' |
5 | import { CONFIG } from '../initializers/config' | 5 | import { CONFIG } from '../initializers/config' |
6 | import { dirname, join } from 'path' | 6 | import { dirname, join } from 'path' |
7 | import * as createTorrent from 'create-torrent' | ||
8 | import { promisify2 } from './core-utils' | ||
7 | 9 | ||
8 | async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName?: string }, timeout: number) { | 10 | async 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 | ||
62 | const createTorrentPromise = promisify2<string, any, any>(createTorrent) | ||
63 | |||
60 | // --------------------------------------------------------------------------- | 64 | // --------------------------------------------------------------------------- |
61 | 65 | ||
62 | export { | 66 | export { |
67 | createTorrentPromise, | ||
63 | downloadWebTorrentVideo | 68 | downloadWebTorrentVideo |
64 | } | 69 | } |
65 | 70 | ||