aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-19 09:28:35 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-19 09:28:35 +0200
commit9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (patch)
treed95149e0e921b4d309e2766cf9566dc0928ae9e5 /server/models/video
parent4dd551a06642351786c28d39fe3fe29939baca54 (diff)
downloadPeerTube-9fd540562c356cb54b98861d2d9e7d4fbfcd00e0.tar.gz
PeerTube-9fd540562c356cb54b98861d2d9e7d4fbfcd00e0.tar.zst
PeerTube-9fd540562c356cb54b98861d2d9e7d4fbfcd00e0.zip
Fix video removing when it is corrupted
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index fb18a485a..4bd8eb98f 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
334 334
335 // Remove physical files and torrents 335 // Remove physical files and torrents
336 video.VideoFiles.forEach(file => { 336 video.VideoFiles.forEach(file => {
337 video.removeFile(file), 337 tasks.push(video.removeFile(file))
338 video.removeTorrent(file) 338 tasks.push(video.removeTorrent(file))
339 }) 339 })
340 } 340 }
341 341
342 return Promise.all(tasks) 342 return Promise.all(tasks)
343 .catch(err => {
344 logger.error('Some errors when removing files of video %d in after destroy hook.', video.uuid, err)
345 })
343} 346}
344 347
345getOriginalFile = function (this: VideoInstance) { 348getOriginalFile = function (this: VideoInstance) {