aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs/webtorrent.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:47:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit254d3579f5338f5fd775c17d15cdfc37078bcfb4 (patch)
treeeaeb13fda16c16e98cd6991d202b0ca6a4cbdb63 /shared/extra-utils/miscs/webtorrent.ts
parent89d241a79c262b9775c233b73cff080043ebb5e6 (diff)
downloadPeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.gz
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.tar.zst
PeerTube-254d3579f5338f5fd775c17d15cdfc37078bcfb4.zip
Use an object to represent a server
Diffstat (limited to 'shared/extra-utils/miscs/webtorrent.ts')
-rw-r--r--shared/extra-utils/miscs/webtorrent.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/extra-utils/miscs/webtorrent.ts b/shared/extra-utils/miscs/webtorrent.ts
index 84e390b2a..815ea3d56 100644
--- a/shared/extra-utils/miscs/webtorrent.ts
+++ b/shared/extra-utils/miscs/webtorrent.ts
@@ -2,7 +2,7 @@ import { readFile } from 'fs-extra'
2import * as parseTorrent from 'parse-torrent' 2import * as parseTorrent from 'parse-torrent'
3import { join } from 'path' 3import { join } from 'path'
4import * as WebTorrent from 'webtorrent' 4import * as WebTorrent from 'webtorrent'
5import { ServerInfo } from '../server' 5import { PeerTubeServer } from '../server'
6 6
7let webtorrent: WebTorrent.Instance 7let webtorrent: WebTorrent.Instance
8 8
@@ -15,7 +15,7 @@ function webtorrentAdd (torrent: string, refreshWebTorrent = false) {
15 return new Promise<WebTorrent.Torrent>(res => webtorrent.add(torrent, res)) 15 return new Promise<WebTorrent.Torrent>(res => webtorrent.add(torrent, res))
16} 16}
17 17
18async function parseTorrentVideo (server: ServerInfo, videoUUID: string, resolution: number) { 18async function parseTorrentVideo (server: PeerTubeServer, videoUUID: string, resolution: number) {
19 const torrentName = videoUUID + '-' + resolution + '.torrent' 19 const torrentName = videoUUID + '-' + resolution + '.torrent'
20 const torrentPath = server.servers.buildDirectory(join('torrents', torrentName)) 20 const torrentPath = server.servers.buildDirectory(join('torrents', torrentName))
21 21