diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-02 15:47:05 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-02 16:57:53 +0200 |
commit | 304a84d59c3a800b7f7aef48cf55f307534c0926 (patch) | |
tree | e099aefd76aa8ee5aacef7ddfc59d79111fe474b /server/lib/activitypub/process/process-update.ts | |
parent | c56faf0d9453490737f283b29a203bb1ca632b95 (diff) | |
download | PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.tar.gz PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.tar.zst PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.zip |
Refactor getOrCreateAPVideo
Diffstat (limited to 'server/lib/activitypub/process/process-update.ts')
-rw-r--r-- | server/lib/activitypub/process/process-update.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.ts index 516bd8d70..be3f6acac 100644 --- a/server/lib/activitypub/process/process-update.ts +++ b/server/lib/activitypub/process/process-update.ts | |||
@@ -17,7 +17,7 @@ import { getImageInfoIfExists, updateActorImageInstance, updateActorInstance } f | |||
17 | import { createOrUpdateCacheFile } from '../cache-file' | 17 | import { createOrUpdateCacheFile } from '../cache-file' |
18 | import { createOrUpdateVideoPlaylist } from '../playlist' | 18 | import { createOrUpdateVideoPlaylist } from '../playlist' |
19 | import { forwardVideoRelatedActivity } from '../send/utils' | 19 | import { forwardVideoRelatedActivity } from '../send/utils' |
20 | import { APVideoUpdater, getOrCreateVideoAndAccountAndChannel } from '../videos' | 20 | import { APVideoUpdater, getOrCreateAPVideo } from '../videos' |
21 | 21 | ||
22 | async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate>) { | 22 | async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate>) { |
23 | const { activity, byActor } = options | 23 | const { activity, byActor } = options |
@@ -63,7 +63,7 @@ async function processUpdateVideo (activity: ActivityUpdate) { | |||
63 | return undefined | 63 | return undefined |
64 | } | 64 | } |
65 | 65 | ||
66 | const { video, created } = await getOrCreateVideoAndAccountAndChannel({ | 66 | const { video, created } = await getOrCreateAPVideo({ |
67 | videoObject: videoObject.id, | 67 | videoObject: videoObject.id, |
68 | allowRefresh: false, | 68 | allowRefresh: false, |
69 | fetchType: 'all' | 69 | fetchType: 'all' |
@@ -85,7 +85,7 @@ async function processUpdateCacheFile (byActor: MActorSignature, activity: Activ | |||
85 | return undefined | 85 | return undefined |
86 | } | 86 | } |
87 | 87 | ||
88 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: cacheFileObject.object }) | 88 | const { video } = await getOrCreateAPVideo({ videoObject: cacheFileObject.object }) |
89 | 89 | ||
90 | await sequelizeTypescript.transaction(async t => { | 90 | await sequelizeTypescript.transaction(async t => { |
91 | await createOrUpdateCacheFile(cacheFileObject, video, byActor, t) | 91 | await createOrUpdateCacheFile(cacheFileObject, video, byActor, t) |