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:
parent
8113a93a0d
commit
72c7248b6f
56 changed files with 2011 additions and 280 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue