1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Add video channels

This commit is contained in:
Chocobozzz 2017-10-24 19:41:09 +02:00
parent 8113a93a0d
commit 72c7248b6f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
56 changed files with 2011 additions and 280 deletions

View file

@ -4,9 +4,12 @@ import { join } from 'path'
import { checkErrors } from './utils'
import { CONFIG } from '../../initializers'
import { logger } from '../../helpers'
import { checkVideoExists, isVideoIdOrUUIDValid } from '../../helpers/custom-validators/videos'
import { isTestInstance } from '../../helpers/core-utils'
import {
logger,
isTestInstance,
checkVideoExists,
isIdOrUUIDValid
} from '../../helpers'
const urlShouldStartWith = CONFIG.WEBSERVER.SCHEME + '://' + join(CONFIG.WEBSERVER.HOST, 'videos', 'watch') + '/'
const videoWatchRegex = new RegExp('([^/]+)$')
@ -45,7 +48,7 @@ const oembedValidator = [
}
const videoId = matches[1]
if (isVideoIdOrUUIDValid(videoId) === false) {
if (isIdOrUUIDValid(videoId) === false) {
return res.status(400)
.json({ error: 'Invalid video id.' })
.end()