Add ability to disable webtorrent

In favour of HLS
This commit is contained in:
Chocobozzz
2019-11-15 15:06:03 +01:00
parent 14981d7331
commit d7a25329f9
80 changed files with 1189 additions and 540 deletions

View File

@@ -118,6 +118,9 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti
'1080p': false,
'2160p': false
},
webtorrent: {
enabled: true
},
hls: {
enabled: false
}

View File

@@ -573,7 +573,6 @@ async function completeVideoCheck (
// Transcoding enabled: extension will always be .mp4
if (attributes.files.length > 1) extension = '.mp4'
const magnetUri = file.magnetUri
expect(file.magnetUri).to.have.lengthOf.above(2)
expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution.id}.torrent`)
expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution.id}${extension}`)
@@ -594,7 +593,7 @@ async function completeVideoCheck (
await testImage(url, attributes.previewfile, videoDetails.previewPath)
}
const torrent = await webtorrentAdd(magnetUri, true)
const torrent = await webtorrentAdd(file.magnetUri, true)
expect(torrent.files).to.be.an('array')
expect(torrent.files.length).to.equal(1)
expect(torrent.files[0].path).to.exist.and.to.not.equal('')