aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-15 15:06:03 +0100
committerChocobozzz <me@florianbigard.com>2019-11-25 10:59:43 +0100
commitd7a25329f9e607894d29ab342b9cb66638b56dc0 (patch)
tree6cd6bc4f2689f78944238b313c93427423a932ac /shared/extra-utils
parent14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff)
downloadPeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.gz
PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.zst
PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.zip
Add ability to disable webtorrent
In favour of HLS
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/server/config.ts3
-rw-r--r--shared/extra-utils/videos/videos.ts3
2 files changed, 4 insertions, 2 deletions
diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts
index 578dd35cf..ada173313 100644
--- a/shared/extra-utils/server/config.ts
+++ b/shared/extra-utils/server/config.ts
@@ -118,6 +118,9 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti
118 '1080p': false, 118 '1080p': false,
119 '2160p': false 119 '2160p': false
120 }, 120 },
121 webtorrent: {
122 enabled: true
123 },
121 hls: { 124 hls: {
122 enabled: false 125 enabled: false
123 } 126 }
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index 75f7d58d7..1fcc949da 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -573,7 +573,6 @@ async function completeVideoCheck (
573 // Transcoding enabled: extension will always be .mp4 573 // Transcoding enabled: extension will always be .mp4
574 if (attributes.files.length > 1) extension = '.mp4' 574 if (attributes.files.length > 1) extension = '.mp4'
575 575
576 const magnetUri = file.magnetUri
577 expect(file.magnetUri).to.have.lengthOf.above(2) 576 expect(file.magnetUri).to.have.lengthOf.above(2)
578 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution.id}.torrent`) 577 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution.id}.torrent`)
579 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution.id}${extension}`) 578 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution.id}${extension}`)
@@ -594,7 +593,7 @@ async function completeVideoCheck (
594 await testImage(url, attributes.previewfile, videoDetails.previewPath) 593 await testImage(url, attributes.previewfile, videoDetails.previewPath)
595 } 594 }
596 595
597 const torrent = await webtorrentAdd(magnetUri, true) 596 const torrent = await webtorrentAdd(file.magnetUri, true)
598 expect(torrent.files).to.be.an('array') 597 expect(torrent.files).to.be.an('array')
599 expect(torrent.files.length).to.equal(1) 598 expect(torrent.files.length).to.equal(1)
600 expect(torrent.files[0].path).to.exist.and.to.not.equal('') 599 expect(torrent.files[0].path).to.exist.and.to.not.equal('')