1
0
Fork 0

Fix video removing when it is corrupted

This commit is contained in:
Chocobozzz 2017-10-19 09:28:35 +02:00
parent 4dd551a066
commit 9fd540562c
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -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) {