diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-11 17:23:24 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 8d2be0ed7bb87283a1ec98609df6b82d83db706a (patch) | |
tree | 31a36b252df32be83ceb77658a53b57f9d15e8ac /shared/extra-utils/miscs/miscs.ts | |
parent | dba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8 (diff) | |
download | PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.gz PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.zst PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.zip |
WIP plugins: move plugin CLI in peertube script
Install/uninstall/list plugins remotely
Diffstat (limited to 'shared/extra-utils/miscs/miscs.ts')
-rw-r--r-- | shared/extra-utils/miscs/miscs.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared/extra-utils/miscs/miscs.ts b/shared/extra-utils/miscs/miscs.ts index fb6430e4f..42250886c 100644 --- a/shared/extra-utils/miscs/miscs.ts +++ b/shared/extra-utils/miscs/miscs.ts | |||
@@ -8,7 +8,7 @@ import { pathExists, readFile } from 'fs-extra' | |||
8 | import * as ffmpeg from 'fluent-ffmpeg' | 8 | import * as ffmpeg from 'fluent-ffmpeg' |
9 | 9 | ||
10 | const expect = chai.expect | 10 | const expect = chai.expect |
11 | let webtorrent = new WebTorrent() | 11 | let webtorrent: WebTorrent.Instance |
12 | 12 | ||
13 | function immutableAssign <T, U> (target: T, source: U) { | 13 | function immutableAssign <T, U> (target: T, source: U) { |
14 | return Object.assign<{}, T, U>({}, target, source) | 14 | return Object.assign<{}, T, U>({}, target, source) |
@@ -27,6 +27,9 @@ function wait (milliseconds: number) { | |||
27 | } | 27 | } |
28 | 28 | ||
29 | function webtorrentAdd (torrent: string, refreshWebTorrent = false) { | 29 | function webtorrentAdd (torrent: string, refreshWebTorrent = false) { |
30 | const WebTorrent = require('webtorrent') | ||
31 | |||
32 | if (!webtorrent) webtorrent = new WebTorrent() | ||
30 | if (refreshWebTorrent === true) webtorrent = new WebTorrent() | 33 | if (refreshWebTorrent === true) webtorrent = new WebTorrent() |
31 | 34 | ||
32 | return new Promise<WebTorrent.Torrent>(res => webtorrent.add(torrent, res)) | 35 | return new Promise<WebTorrent.Torrent>(res => webtorrent.add(torrent, res)) |