]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video.ts
Server shares user videos
[github/Chocobozzz/PeerTube.git] / server / models / video / video.ts
index b00081f25ef54966f49a588be353de849d24aafe..64ee7ae344b94e53e06180cffb9b56cb57eb962c 100644 (file)
@@ -253,9 +253,6 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da
         },
         {
           fields: [ 'channelId' ]
-        },
-        {
-          fields: [ 'parentId' ]
         }
       ],
       hooks: {
@@ -329,14 +326,6 @@ function associate (models) {
     onDelete: 'cascade'
   })
 
-  Video.belongsTo(models.Video, {
-    foreignKey: {
-      name: 'parentId',
-      allowNull: true
-    },
-    onDelete: 'cascade'
-  })
-
   Video.belongsToMany(models.Tag, {
     foreignKey: 'videoId',
     through: models.VideoTag,
@@ -569,7 +558,7 @@ toActivityPubObject = function (this: VideoInstance) {
   for (const file of this.VideoFiles) {
     url.push({
       type: 'Link',
-      mimeType: 'video/' + file.extname,
+      mimeType: 'video/' + file.extname.replace('.', ''),
       url: getVideoFileUrl(this, file, baseUrlHttp),
       width: file.resolution,
       size: file.size
@@ -612,8 +601,8 @@ toActivityPubObject = function (this: VideoInstance) {
     },
     views: this.views,
     nsfw: this.nsfw,
-    published: this.createdAt,
-    updated: this.updatedAt,
+    published: this.createdAt.toISOString(),
+    updated: this.updatedAt.toISOString(),
     mediaType: 'text/markdown',
     content: this.getTruncatedDescription(),
     icon: {