Fix video removing when it is corrupted
This commit is contained in:
parent
4dd551a066
commit
9fd540562c
|
@ -334,12 +334,15 @@ function afterDestroy (video: VideoInstance, options: { transaction: Sequelize.T
|
||||||
|
|
||||||
// Remove physical files and torrents
|
// Remove physical files and torrents
|
||||||
video.VideoFiles.forEach(file => {
|
video.VideoFiles.forEach(file => {
|
||||||
video.removeFile(file),
|
tasks.push(video.removeFile(file))
|
||||||
video.removeTorrent(file)
|
tasks.push(video.removeTorrent(file))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(tasks)
|
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) {
|
getOriginalFile = function (this: VideoInstance) {
|
||||||
|
|
Loading…
Reference in New Issue