]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video.ts
Fix video upload and videos list
[github/Chocobozzz/PeerTube.git] / server / models / video / video.ts
index 86800fb8897248a1411ff5e80e283db94d1be32b..b00081f25ef54966f49a588be353de849d24aafe 100644 (file)
@@ -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,