aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/redundancy
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/redundancy')
-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,