aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/redundancy/video-redundancy.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-11-16 11:18:13 +0100
committerChocobozzz <me@florianbigard.com>2018-11-16 11:18:13 +0100
commit8d1fa36ad22a21a9b0fb6bf51a27d09954220013 (patch)
treee2a8ea0277c05d7f0729ab2eed395e2ea6f3809d /server/models/redundancy/video-redundancy.ts
parent7373507fa830b0f18cb4cd95dfd923b1600e501d (diff)
downloadPeerTube-8d1fa36ad22a21a9b0fb6bf51a27d09954220013.tar.gz
PeerTube-8d1fa36ad22a21a9b0fb6bf51a27d09954220013.tar.zst
PeerTube-8d1fa36ad22a21a9b0fb6bf51a27d09954220013.zip
Do not host remote AP objects
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,