},
{
fields: [ 'channelId' ]
- },
- {
- fields: [ 'parentId' ]
}
],
hooks: {
onDelete: 'cascade'
})
- Video.belongsTo(models.Video, {
- foreignKey: {
- name: 'parentId',
- allowNull: true
- },
- onDelete: 'cascade'
- })
-
Video.belongsToMany(models.Tag, {
foreignKey: 'videoId',
through: models.VideoTag,
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
},
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: {