mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-26 02:30:37 -06:00
Fix tests
This commit is contained in:
parent
cf60f7af03
commit
4434e78c56
@ -145,8 +145,13 @@ async function completeCheckHlsPlaylist (options: {
|
|||||||
expect(file.resolution.label).to.equal(resolution + 'p')
|
expect(file.resolution.label).to.equal(resolution + 'p')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (resolution === 0) {
|
||||||
|
expect(file.height).to.equal(0)
|
||||||
|
expect(file.width).to.equal(0)
|
||||||
|
} else {
|
||||||
expect(Math.min(file.height, file.width)).to.equal(resolution)
|
expect(Math.min(file.height, file.width)).to.equal(resolution)
|
||||||
expect(Math.max(file.height, file.width)).to.be.greaterThan(resolution)
|
expect(Math.max(file.height, file.width)).to.be.greaterThan(resolution)
|
||||||
|
}
|
||||||
|
|
||||||
expect(file.magnetUri).to.have.lengthOf.above(2)
|
expect(file.magnetUri).to.have.lengthOf.above(2)
|
||||||
await checkWebTorrentWorks(file.magnetUri)
|
await checkWebTorrentWorks(file.magnetUri)
|
||||||
|
@ -104,8 +104,13 @@ export async function completeWebVideoFilesCheck (options: {
|
|||||||
if (attributeFile.width !== undefined) expect(file.width).to.equal(attributeFile.width)
|
if (attributeFile.width !== undefined) expect(file.width).to.equal(attributeFile.width)
|
||||||
if (attributeFile.height !== undefined) expect(file.height).to.equal(attributeFile.height)
|
if (attributeFile.height !== undefined) expect(file.height).to.equal(attributeFile.height)
|
||||||
|
|
||||||
|
if (file.resolution.id === VideoResolution.H_NOVIDEO) {
|
||||||
|
expect(file.height).to.equal(0)
|
||||||
|
expect(file.width).to.equal(0)
|
||||||
|
} else {
|
||||||
expect(Math.min(file.height, file.width)).to.equal(file.resolution.id)
|
expect(Math.min(file.height, file.width)).to.equal(file.resolution.id)
|
||||||
expect(Math.max(file.height, file.width)).to.be.greaterThan(file.resolution.id)
|
expect(Math.max(file.height, file.width)).to.be.greaterThan(file.resolution.id)
|
||||||
|
}
|
||||||
|
|
||||||
if (attributeFile.size) {
|
if (attributeFile.size) {
|
||||||
const minSize = attributeFile.size - ((10 * attributeFile.size) / 100)
|
const minSize = attributeFile.size - ((10 * attributeFile.size) / 100)
|
||||||
|
@ -27,7 +27,10 @@ async function buildNewFile (options: {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (await isAudioFile(path, probe)) {
|
if (await isAudioFile(path, probe)) {
|
||||||
|
videoFile.fps = 0
|
||||||
videoFile.resolution = VideoResolution.H_NOVIDEO
|
videoFile.resolution = VideoResolution.H_NOVIDEO
|
||||||
|
videoFile.width = 0
|
||||||
|
videoFile.height = 0
|
||||||
} else {
|
} else {
|
||||||
const dimensions = await getVideoStreamDimensionsInfo(path, probe)
|
const dimensions = await getVideoStreamDimensionsInfo(path, probe)
|
||||||
videoFile.fps = await getVideoStreamFPS(path, probe)
|
videoFile.fps = await getVideoStreamFPS(path, probe)
|
||||||
|
Loading…
Reference in New Issue
Block a user