Fix video removing when it is corrupted

pull/108/head
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
1 changed files with 5 additions and 2 deletions

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