From 8d1fa36ad22a21a9b0fb6bf51a27d09954220013 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Nov 2018 11:18:13 +0100 Subject: Do not host remote AP objects --- server/models/redundancy/video-redundancy.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server/models/redundancy') 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 { @BeforeDestroy static async removeFile (instance: VideoRedundancyModel) { - // Not us - if (!instance.strategy) return + if (!instance.isOwned()) return const videoFile = await VideoFileModel.loadWithVideo(instance.videoFileId) @@ -404,6 +403,10 @@ export class VideoRedundancyModel extends Model { })) } + isOwned () { + return !!this.strategy + } + toActivityPubObject (): CacheFileObject { return { id: this.url, -- cgit v1.2.3