-function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {
- // Should have files
- if (!files) return false
- if (isArray(files)) return false
-
- // Should have videofile file
- const videofile = files['videofile']
- if (!videofile || videofile.length === 0) return false
+function isVideoFileInfoHashValid (value: string | null | undefined) {
+ return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.INFO_HASH)
+}