aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-03 09:14:56 +0100
committerChocobozzz <me@florianbigard.com>2018-12-03 09:14:56 +0100
commitdbe6aa698eaacf9125d2c4232dee6e3e1f0d7ba1 (patch)
treeb844e12a501fa14b4806a222bf162e7dc0f086f0 /server/lib/activitypub
parent1a8dd4da77468068d1ff7f7bd67f76399ae04e04 (diff)
downloadPeerTube-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.ts13
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
87async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { 87async 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
96async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) { 105async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) {