diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-22 16:15:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | 1297eb5db651a230474670c5da1517862fb9cc3e (patch) | |
tree | ecad4a0ceb0bb09e3c775262691ac68e9e0aca0c /server/lib/activitypub/process/process-create.ts | |
parent | f6eebcb336c067e160a62020a5140d8d992ba384 (diff) | |
download | PeerTube-1297eb5db651a230474670c5da1517862fb9cc3e.tar.gz PeerTube-1297eb5db651a230474670c5da1517862fb9cc3e.tar.zst PeerTube-1297eb5db651a230474670c5da1517862fb9cc3e.zip |
Add refresh video on search
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 9655d015f..e8f5ade06 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -10,7 +10,7 @@ import { VideoAbuseModel } from '../../../models/video/video-abuse' | |||
10 | import { VideoCommentModel } from '../../../models/video/video-comment' | 10 | import { VideoCommentModel } from '../../../models/video/video-comment' |
11 | import { getOrCreateActorAndServerAndModel } from '../actor' | 11 | import { getOrCreateActorAndServerAndModel } from '../actor' |
12 | import { resolveThread } from '../video-comments' | 12 | import { resolveThread } from '../video-comments' |
13 | import { getOrCreateAccountAndVideoAndChannel } from '../videos' | 13 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' |
14 | import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils' | 14 | import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils' |
15 | 15 | ||
16 | async function processCreateActivity (activity: ActivityCreate) { | 16 | async function processCreateActivity (activity: ActivityCreate) { |
@@ -45,7 +45,7 @@ export { | |||
45 | async function processCreateVideo (activity: ActivityCreate) { | 45 | async function processCreateVideo (activity: ActivityCreate) { |
46 | const videoToCreateData = activity.object as VideoTorrentObject | 46 | const videoToCreateData = activity.object as VideoTorrentObject |
47 | 47 | ||
48 | const { video } = await getOrCreateAccountAndVideoAndChannel(videoToCreateData) | 48 | const { video } = await getOrCreateVideoAndAccountAndChannel(videoToCreateData) |
49 | 49 | ||
50 | return video | 50 | return video |
51 | } | 51 | } |
@@ -56,7 +56,7 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
56 | 56 | ||
57 | if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url) | 57 | if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url) |
58 | 58 | ||
59 | const { video } = await getOrCreateAccountAndVideoAndChannel(dislike.object) | 59 | const { video } = await getOrCreateVideoAndAccountAndChannel(dislike.object) |
60 | 60 | ||
61 | return sequelizeTypescript.transaction(async t => { | 61 | return sequelizeTypescript.transaction(async t => { |
62 | const rate = { | 62 | const rate = { |
@@ -83,7 +83,7 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
83 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { | 83 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { |
84 | const view = activity.object as ViewObject | 84 | const view = activity.object as ViewObject |
85 | 85 | ||
86 | const { video } = await getOrCreateAccountAndVideoAndChannel(view.object) | 86 | const { video } = await getOrCreateVideoAndAccountAndChannel(view.object) |
87 | 87 | ||
88 | const actor = await ActorModel.loadByUrl(view.actor) | 88 | const actor = await ActorModel.loadByUrl(view.actor) |
89 | if (!actor) throw new Error('Unknown actor ' + view.actor) | 89 | if (!actor) throw new Error('Unknown actor ' + view.actor) |
@@ -103,7 +103,7 @@ async function processCreateVideoAbuse (actor: ActorModel, videoAbuseToCreateDat | |||
103 | const account = actor.Account | 103 | const account = actor.Account |
104 | if (!account) throw new Error('Cannot create dislike with the non account actor ' + actor.url) | 104 | if (!account) throw new Error('Cannot create dislike with the non account actor ' + actor.url) |
105 | 105 | ||
106 | const { video } = await getOrCreateAccountAndVideoAndChannel(videoAbuseToCreateData.object) | 106 | const { video } = await getOrCreateVideoAndAccountAndChannel(videoAbuseToCreateData.object) |
107 | 107 | ||
108 | return sequelizeTypescript.transaction(async t => { | 108 | return sequelizeTypescript.transaction(async t => { |
109 | const videoAbuseData = { | 109 | const videoAbuseData = { |