aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-01 16:27:47 +0200
committerChocobozzz <me@florianbigard.com>2018-10-01 16:27:47 +0200
commita3737cbf2b09d5ce75e50f333d989a6162b04720 (patch)
treeb70091c20ff0b57513f40bb703509352bba296e3 /server/lib/activitypub
parentd382f4e9175c1520835e41c3573471a84bcf1713 (diff)
downloadPeerTube-a3737cbf2b09d5ce75e50f333d989a6162b04720.tar.gz
PeerTube-a3737cbf2b09d5ce75e50f333d989a6162b04720.tar.zst
PeerTube-a3737cbf2b09d5ce75e50f333d989a6162b04720.zip
Fix video fps validator
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index 34685b6b1..cd1bc4e06 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -455,11 +455,11 @@ async function videoActivityObjectToDBAttributes (
455 } 455 }
456} 456}
457 457
458function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObject: VideoTorrentObject) { 458function videoFileActivityUrlToDBAttributes (video: VideoModel, videoObject: VideoTorrentObject) {
459 const fileUrls = videoObject.url.filter(u => isActivityVideoUrlObject(u)) as ActivityVideoUrlObject[] 459 const fileUrls = videoObject.url.filter(u => isActivityVideoUrlObject(u)) as ActivityVideoUrlObject[]
460 460
461 if (fileUrls.length === 0) { 461 if (fileUrls.length === 0) {
462 throw new Error('Cannot find video files for ' + videoCreated.url) 462 throw new Error('Cannot find video files for ' + video.url)
463 } 463 }
464 464
465 const attributes: VideoFileModel[] = [] 465 const attributes: VideoFileModel[] = []
@@ -481,7 +481,7 @@ function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObje
481 infoHash: parsed.infoHash, 481 infoHash: parsed.infoHash,
482 resolution: fileUrl.height, 482 resolution: fileUrl.height,
483 size: fileUrl.size, 483 size: fileUrl.size,
484 videoId: videoCreated.id, 484 videoId: video.id,
485 fps: fileUrl.fps || -1 485 fps: fileUrl.fps || -1
486 } as VideoFileModel 486 } as VideoFileModel
487 attributes.push(attribute) 487 attributes.push(attribute)