aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-14 10:57:56 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commite34c85e527100c0b5c44567bd951e95be41b8d7e (patch)
tree39697c5a4dda2c2e07142a8522538db783fce2fd /server/models/video/video.ts
parent1e1265b36c09df1465aa2b4866815c957b6a532e (diff)
downloadPeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.gz
PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.tar.zst
PeerTube-e34c85e527100c0b5c44567bd951e95be41b8d7e.zip
Fix issues on server start
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index ca71da375..dd73dd7ca 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -46,6 +46,7 @@ import { TagInstance } from './tag-interface'
46import { VideoFileInstance, VideoFileModel } from './video-file-interface' 46import { VideoFileInstance, VideoFileModel } from './video-file-interface'
47import { VideoAttributes, VideoInstance, VideoMethods } from './video-interface' 47import { VideoAttributes, VideoInstance, VideoMethods } from './video-interface'
48import { sendDeleteVideo } from '../../lib/activitypub/send-request' 48import { sendDeleteVideo } from '../../lib/activitypub/send-request'
49import { isVideoUrlValid } from '../../helpers/custom-validators/videos'
49 50
50const Buffer = safeBuffer.Buffer 51const Buffer = safeBuffer.Buffer
51 52
@@ -220,10 +221,13 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
220 defaultValue: false 221 defaultValue: false
221 }, 222 },
222 url: { 223 url: {
223 type: DataTypes.STRING, 224 type: DataTypes.STRING(CONSTRAINTS_FIELDS.VIDEOS.URL.max),
224 allowNull: false, 225 allowNull: false,
225 validate: { 226 validate: {
226 isUrl: true 227 urlValid: value => {
228 const res = isVideoUrlValid(value)
229 if (res === false) throw new Error('Video URL is not valid.')
230 }
227 } 231 }
228 } 232 }
229 }, 233 },