diff options
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 32e555acf..99841da14 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -48,7 +48,7 @@ export { | |||
48 | async function processCreateVideo (activity: ActivityCreate) { | 48 | async function processCreateVideo (activity: ActivityCreate) { |
49 | const videoToCreateData = activity.object as VideoTorrentObject | 49 | const videoToCreateData = activity.object as VideoTorrentObject |
50 | 50 | ||
51 | const { video } = await getOrCreateVideoAndAccountAndChannel(videoToCreateData) | 51 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: videoToCreateData }) |
52 | 52 | ||
53 | return video | 53 | return video |
54 | } | 54 | } |
@@ -59,7 +59,7 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
59 | 59 | ||
60 | if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url) | 60 | if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url) |
61 | 61 | ||
62 | const { video } = await getOrCreateVideoAndAccountAndChannel(dislike.object) | 62 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: dislike.object }) |
63 | 63 | ||
64 | return sequelizeTypescript.transaction(async t => { | 64 | return sequelizeTypescript.transaction(async t => { |
65 | const rate = { | 65 | const rate = { |
@@ -86,7 +86,7 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea | |||
86 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { | 86 | async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { |
87 | const view = activity.object as ViewObject | 87 | const view = activity.object as ViewObject |
88 | 88 | ||
89 | const { video } = await getOrCreateVideoAndAccountAndChannel(view.object) | 89 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: view.object }) |
90 | 90 | ||
91 | const actor = await ActorModel.loadByUrl(view.actor) | 91 | const actor = await ActorModel.loadByUrl(view.actor) |
92 | if (!actor) throw new Error('Unknown actor ' + view.actor) | 92 | if (!actor) throw new Error('Unknown actor ' + view.actor) |
@@ -103,7 +103,7 @@ async function processCreateView (byActor: ActorModel, activity: ActivityCreate) | |||
103 | async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) { | 103 | async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) { |
104 | const cacheFile = activity.object as CacheFileObject | 104 | const cacheFile = activity.object as CacheFileObject |
105 | 105 | ||
106 | const { video } = await getOrCreateVideoAndAccountAndChannel(cacheFile.object) | 106 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: cacheFile.object }) |
107 | 107 | ||
108 | await createCacheFile(cacheFile, video, byActor) | 108 | await createCacheFile(cacheFile, video, byActor) |
109 | 109 | ||
@@ -120,7 +120,7 @@ async function processCreateVideoAbuse (actor: ActorModel, videoAbuseToCreateDat | |||
120 | const account = actor.Account | 120 | const account = actor.Account |
121 | if (!account) throw new Error('Cannot create dislike with the non account actor ' + actor.url) | 121 | if (!account) throw new Error('Cannot create dislike with the non account actor ' + actor.url) |
122 | 122 | ||
123 | const { video } = await getOrCreateVideoAndAccountAndChannel(videoAbuseToCreateData.object) | 123 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: videoAbuseToCreateData.object }) |
124 | 124 | ||
125 | return sequelizeTypescript.transaction(async t => { | 125 | return sequelizeTypescript.transaction(async t => { |
126 | const videoAbuseData = { | 126 | const videoAbuseData = { |