From b2977eecb8eb5d599df0c6a7ab99a437a6a969c7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Aug 2018 17:00:19 +0200 Subject: Fix fps federation --- server/helpers/activitypub.ts | 1 + server/helpers/custom-validators/activitypub/videos.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'server/helpers') diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index d710f5c97..a9de11fb0 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts @@ -24,6 +24,7 @@ function activityPubContextify (data: T) { views: 'http://schema.org/Number', stats: 'http://schema.org/Number', size: 'http://schema.org/Number', + fps: 'http://schema.org/Number', commentsEnabled: 'http://schema.org/Boolean', waitTranscoding: 'http://schema.org/Boolean', support: 'http://schema.org/Text' diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index c6a350236..b8075f3c7 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts @@ -153,7 +153,8 @@ function isRemoteVideoUrlValid (url: any) { ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mimeType) !== -1 && isActivityPubUrlValid(url.href) && validator.isInt(url.width + '', { min: 0 }) && - validator.isInt(url.size + '', { min: 0 }) + validator.isInt(url.size + '', { min: 0 }) && + (!url.fps || validator.isInt(url.fps + '', { min: 0 })) ) || ( ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mimeType) !== -1 && -- cgit v1.2.3