aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/videos/videos.ts')
-rw-r--r--shared/extra-utils/videos/videos.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index aa13273ae..39a06b0d7 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -1,4 +1,4 @@
1/* tslint:disable:no-unused-expression */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { pathExists, readdir, readFile } from 'fs-extra' 4import { pathExists, readdir, readFile } from 'fs-extra'
@@ -488,7 +488,7 @@ async function completeVideoCheck (
488 description: string 488 description: string
489 publishedAt?: string 489 publishedAt?: string
490 support: string 490 support: string
491 originallyPublishedAt?: string, 491 originallyPublishedAt?: string
492 account: { 492 account: {
493 name: string 493 name: string
494 host: string 494 host: string
@@ -509,7 +509,7 @@ async function completeVideoCheck (
509 files: { 509 files: {
510 resolution: number 510 resolution: number
511 size: number 511 size: number
512 }[], 512 }[]
513 thumbnailfile?: string 513 thumbnailfile?: string
514 previewfile?: string 514 previewfile?: string
515 } 515 }
@@ -583,9 +583,10 @@ async function completeVideoCheck (
583 583
584 const minSize = attributeFile.size - ((10 * attributeFile.size) / 100) 584 const minSize = attributeFile.size - ((10 * attributeFile.size) / 100)
585 const maxSize = attributeFile.size + ((10 * attributeFile.size) / 100) 585 const maxSize = attributeFile.size + ((10 * attributeFile.size) / 100)
586 expect(file.size, 586 expect(
587 'File size for resolution ' + file.resolution.label + ' outside confidence interval (' + minSize + '> size <' + maxSize + ')') 587 file.size,
588 .to.be.above(minSize).and.below(maxSize) 588 'File size for resolution ' + file.resolution.label + ' outside confidence interval (' + minSize + '> size <' + maxSize + ')'
589 ).to.be.above(minSize).and.below(maxSize)
589 590
590 const torrent = await webtorrentAdd(file.magnetUri, true) 591 const torrent = await webtorrentAdd(file.magnetUri, true)
591 expect(torrent.files).to.be.an('array') 592 expect(torrent.files).to.be.an('array')
@@ -608,10 +609,10 @@ async function videoUUIDToId (url: string, id: number | string) {
608} 609}
609 610
610async function uploadVideoAndGetId (options: { 611async function uploadVideoAndGetId (options: {
611 server: ServerInfo, 612 server: ServerInfo
612 videoName: string, 613 videoName: string
613 nsfw?: boolean, 614 nsfw?: boolean
614 privacy?: VideoPrivacy, 615 privacy?: VideoPrivacy
615 token?: string 616 token?: string
616}) { 617}) {
617 const videoAttrs: any = { name: options.videoName } 618 const videoAttrs: any = { name: options.videoName }