aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/miscs')
-rw-r--r--shared/extra-utils/miscs/checks.ts4
-rw-r--r--shared/extra-utils/miscs/webtorrent.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/shared/extra-utils/miscs/checks.ts b/shared/extra-utils/miscs/checks.ts
index 8f7bdb9b5..c81460330 100644
--- a/shared/extra-utils/miscs/checks.ts
+++ b/shared/extra-utils/miscs/checks.ts
@@ -6,7 +6,7 @@ import { join } from 'path'
6import { root } from '@server/helpers/core-utils' 6import { root } from '@server/helpers/core-utils'
7import { HttpStatusCode } from '@shared/core-utils' 7import { HttpStatusCode } from '@shared/core-utils'
8import { makeGetRequest } from '../requests' 8import { makeGetRequest } from '../requests'
9import { ServerInfo } from '../server' 9import { PeerTubeServer } from '../server'
10 10
11// Default interval -> 5 minutes 11// Default interval -> 5 minutes
12function dateIsValid (dateString: string, interval = 300000) { 12function dateIsValid (dateString: string, interval = 300000) {
@@ -33,7 +33,7 @@ async function testImage (url: string, imageName: string, imagePath: string, ext
33 expect(data.length).to.be.below(maxLength, 'the generated image is way larger than the recorded fixture') 33 expect(data.length).to.be.below(maxLength, 'the generated image is way larger than the recorded fixture')
34} 34}
35 35
36async function testFileExistsOrNot (server: ServerInfo, directory: string, filePath: string, exist: boolean) { 36async function testFileExistsOrNot (server: PeerTubeServer, directory: string, filePath: string, exist: boolean) {
37 const base = server.servers.buildDirectory(directory) 37 const base = server.servers.buildDirectory(directory)
38 38
39 expect(await pathExists(join(base, filePath))).to.equal(exist) 39 expect(await pathExists(join(base, filePath))).to.equal(exist)
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