mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-25 18:20:31 -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')
|
||||
}
|
||||
|
||||
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.max(file.height, file.width)).to.be.greaterThan(resolution)
|
||||
}
|
||||
|
||||
expect(file.magnetUri).to.have.lengthOf.above(2)
|
||||
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.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.max(file.height, file.width)).to.be.greaterThan(file.resolution.id)
|
||||
}
|
||||
|
||||
if (attributeFile.size) {
|
||||
const minSize = attributeFile.size - ((10 * attributeFile.size) / 100)
|
||||
|
@ -27,7 +27,10 @@ async function buildNewFile (options: {
|
||||
})
|
||||
|
||||
if (await isAudioFile(path, probe)) {
|
||||
videoFile.fps = 0
|
||||
videoFile.resolution = VideoResolution.H_NOVIDEO
|
||||
videoFile.width = 0
|
||||
videoFile.height = 0
|
||||
} else {
|
||||
const dimensions = await getVideoStreamDimensionsInfo(path, probe)
|
||||
videoFile.fps = await getVideoStreamFPS(path, probe)
|
||||
|
Loading…
Reference in New Issue
Block a user