aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/redundancy/video-redundancy.ts
diff options
context:
space:
mode:
authorbuoyantair <buoyantair@protonmail.com>2018-11-18 21:55:52 +0530
committerbuoyantair <buoyantair@protonmail.com>2018-11-18 21:55:52 +0530
commitb9f234371bfaf0d9cfa81e02fcea92cac1f9ae13 (patch)
treedcdf451ac431ec7953bee58e814f642d1c370d1b /server/models/redundancy/video-redundancy.ts
parent92e07c3b5d9dbf2febedb1b5b87ec676eb6d1ac8 (diff)
parent9d0b856e930ee1c676d16a56408a3e4a18f8f978 (diff)
downloadPeerTube-b9f234371bfaf0d9cfa81e02fcea92cac1f9ae13.tar.gz
PeerTube-b9f234371bfaf0d9cfa81e02fcea92cac1f9ae13.tar.zst
PeerTube-b9f234371bfaf0d9cfa81e02fcea92cac1f9ae13.zip
Merge branch 'develop' of https://github.com/Chocobozzz/PeerTube into move-utils-to-shared
Diffstat (limited to 'server/models/redundancy/video-redundancy.ts')
-rw-r--r--server/models/redundancy/video-redundancy.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts
index 35e0cd3b1..9de4356b4 100644
--- a/server/models/redundancy/video-redundancy.ts
+++ b/server/models/redundancy/video-redundancy.ts
@@ -117,8 +117,7 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
117 117
118 @BeforeDestroy 118 @BeforeDestroy
119 static async removeFile (instance: VideoRedundancyModel) { 119 static async removeFile (instance: VideoRedundancyModel) {
120 // Not us 120 if (!instance.isOwned()) return
121 if (!instance.strategy) return
122 121
123 const videoFile = await VideoFileModel.loadWithVideo(instance.videoFileId) 122 const videoFile = await VideoFileModel.loadWithVideo(instance.videoFileId)
124 123
@@ -404,6 +403,10 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
404 })) 403 }))
405 } 404 }
406 405
406 isOwned () {
407 return !!this.strategy
408 }
409
407 toActivityPubObject (): CacheFileObject { 410 toActivityPubObject (): CacheFileObject {
408 return { 411 return {
409 id: this.url, 412 id: this.url,