diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-03 09:14:56 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-03 09:14:56 +0100 |
commit | dbe6aa698eaacf9125d2c4232dee6e3e1f0d7ba1 (patch) | |
tree | b844e12a501fa14b4806a222bf162e7dc0f086f0 /server/lib/activitypub | |
parent | 1a8dd4da77468068d1ff7f7bd67f76399ae04e04 (diff) | |
download | PeerTube-dbe6aa698eaacf9125d2c4232dee6e3e1f0d7ba1.tar.gz PeerTube-dbe6aa698eaacf9125d2c4232dee6e3e1f0d7ba1.tar.zst PeerTube-dbe6aa698eaacf9125d2c4232dee6e3e1f0d7ba1.zip |
Fix trending page
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index f7fb09fba..cd7ea01aa 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -87,10 +87,19 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
87 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { | 87 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { |
88 | const view = activity.object as ViewObject | 88 | const view = activity.object as ViewObject |
89 | 89 | ||
90 | const video = await VideoModel.loadByUrl(view.object) | 90 | const options = { |
91 | if (!video || video.isOwned() === false) return | 91 | videoObject: view.object, |
92 | fetchType: 'only-video' as 'only-video' | ||
93 | } | ||
94 | const { video } = await getOrCreateVideoAndAccountAndChannel(options) | ||
92 | 95 | ||
93 | await Redis.Instance.addVideoView(video.id) | 96 | await Redis.Instance.addVideoView(video.id) |
97 | |||
98 | if (video.isOwned()) { | ||
99 | // Don't resend the activity to the sender | ||
100 | const exceptions = [ byActor ] | ||
101 | await forwardVideoRelatedActivity(activity, undefined, exceptions, video) | ||
102 | } | ||
94 | } | 103 | } |
95 | 104 | ||
96 | async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) { | 105 | async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) { |