From 8e10cf1a5a438a00e5f7e0691cb830769867cffc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Nov 2017 16:28:35 +0100 Subject: Fix video upload and videos list --- server/models/video/video.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/models/video') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 86800fb88..b00081f25 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -329,7 +329,7 @@ function associate (models) { onDelete: 'cascade' }) - Video.belongsTo(models.VideoChannel, { + Video.belongsTo(models.Video, { foreignKey: { name: 'parentId', allowNull: true @@ -825,9 +825,11 @@ listForApi = function (start: number, count: number, sort: string) { include: [ { model: Video['sequelize'].models.VideoChannel, + required: true, include: [ { model: Video['sequelize'].models.Account, + required: true, include: [ { model: Video['sequelize'].models.Server, -- cgit v1.2.3