diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:45:41 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:58:59 +0100 |
commit | 943e5193905908dd1f2800d8810c635d86e3b28f (patch) | |
tree | 961973733e6e4afb58ac222d2847a3fc4b6d6d60 /server/lib/activitypub/audience.ts | |
parent | 7eba5e1fa81c8e54cb8fe298a96e8070afa50921 (diff) | |
download | PeerTube-943e5193905908dd1f2800d8810c635d86e3b28f.tar.gz PeerTube-943e5193905908dd1f2800d8810c635d86e3b28f.tar.zst PeerTube-943e5193905908dd1f2800d8810c635d86e3b28f.zip |
Don't refresh videos when processing views
It allows us to use a cache
Diffstat (limited to 'server/lib/activitypub/audience.ts')
-rw-r--r-- | server/lib/activitypub/audience.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/lib/activitypub/audience.ts b/server/lib/activitypub/audience.ts index f2ab54cf7..39caeef7b 100644 --- a/server/lib/activitypub/audience.ts +++ b/server/lib/activitypub/audience.ts | |||
@@ -4,7 +4,15 @@ import { ACTIVITY_PUB } from '../../initializers/constants' | |||
4 | import { ActorModel } from '../../models/activitypub/actor' | 4 | import { ActorModel } from '../../models/activitypub/actor' |
5 | import { VideoModel } from '../../models/video/video' | 5 | import { VideoModel } from '../../models/video/video' |
6 | import { VideoShareModel } from '../../models/video/video-share' | 6 | import { VideoShareModel } from '../../models/video/video-share' |
7 | import { MActorFollowersUrl, MActorLight, MCommentOwner, MCommentOwnerVideo, MVideo, MVideoAccountLight } from '../../typings/models' | 7 | import { |
8 | MActorFollowersUrl, | ||
9 | MActorLight, | ||
10 | MCommentOwner, | ||
11 | MCommentOwnerVideo, | ||
12 | MVideo, | ||
13 | MVideoAccountLight, | ||
14 | MVideoId | ||
15 | } from '../../typings/models' | ||
8 | 16 | ||
9 | function getRemoteVideoAudience (video: MVideoAccountLight, actorsInvolvedInVideo: MActorFollowersUrl[]): ActivityAudience { | 17 | function getRemoteVideoAudience (video: MVideoAccountLight, actorsInvolvedInVideo: MActorFollowersUrl[]): ActivityAudience { |
10 | return { | 18 | return { |
@@ -48,7 +56,7 @@ function getAudienceFromFollowersOf (actorsInvolvedInObject: MActorFollowersUrl[ | |||
48 | } | 56 | } |
49 | } | 57 | } |
50 | 58 | ||
51 | async function getActorsInvolvedInVideo (video: MVideo, t: Transaction) { | 59 | async function getActorsInvolvedInVideo (video: MVideoId, t: Transaction) { |
52 | const actors: MActorLight[] = await VideoShareModel.loadActorsByShare(video.id, t) | 60 | const actors: MActorLight[] = await VideoShareModel.loadActorsByShare(video.id, t) |
53 | 61 | ||
54 | const videoAll = video as VideoModel | 62 | const videoAll = video as VideoModel |