mirror of https://github.com/Chocobozzz/PeerTube
Fix deleting a video with comments
parent
d6bd50ba1d
commit
29c6b82944
|
@ -188,6 +188,27 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
|
|||
}) as AccountModel
|
||||
}
|
||||
|
||||
if (!instance.Video) {
|
||||
instance.Video = await instance.$get('Video', {
|
||||
include: [
|
||||
{
|
||||
model: VideoChannelModel,
|
||||
include: [
|
||||
{
|
||||
model: AccountModel,
|
||||
include: [
|
||||
{
|
||||
model: ActorModel
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
transaction: options.transaction
|
||||
}) as VideoModel
|
||||
}
|
||||
|
||||
if (instance.isOwned()) {
|
||||
await sendDeleteVideoComment(instance, options.transaction)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue