Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix video removing when it is corrupted

Chocobozzz9fd540562c35
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index fb18a485a4..4bd8eb98f5 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -334,12 +334,15 @@ function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.T
// Remove physical files and torrents
video.VideoFiles.forEach(file => {
- video.removeFile(file),
- video.removeTorrent(file)
+ tasks.push(video.removeFile(file))
+ tasks.push(video.removeTorrent(file))
})
}
return Promise.all(tasks)
+ .catch(err => {
+ logger.error('Some errors when removing files of video %d in after destroy hook.', video.uuid, err)
+ })
}
getOriginalFile = function (this: VideoInstance) {