isActivityPubUrlValid(url.href) &&
validator.isInt(url.height + '', { min: 0 }) &&
validator.isInt(url.size + '', { min: 0 }) &&
- (!url.fps || validator.isInt(url.fps + '', { min: 0 }))
+ (!url.fps || validator.isInt(url.fps + '', { min: -1 }))
) ||
(
ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mimeType) !== -1 &&
}
}
-function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObject: VideoTorrentObject) {
+function videoFileActivityUrlToDBAttributes (video: VideoModel, videoObject: VideoTorrentObject) {
const fileUrls = videoObject.url.filter(u => isActivityVideoUrlObject(u)) as ActivityVideoUrlObject[]
if (fileUrls.length === 0) {
- throw new Error('Cannot find video files for ' + videoCreated.url)
+ throw new Error('Cannot find video files for ' + video.url)
}
const attributes: VideoFileModel[] = []
infoHash: parsed.infoHash,
resolution: fileUrl.height,
size: fileUrl.size,
- videoId: videoCreated.id,
+ videoId: video.id,
fps: fileUrl.fps || -1
} as VideoFileModel
attributes.push(attribute)