mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Refactor getOrCreateAPVideo
This commit is contained in:
parent
c56faf0d94
commit
304a84d59c
19 changed files with 243 additions and 209 deletions
|
@ -17,7 +17,7 @@ import { getImageInfoIfExists, updateActorImageInstance, updateActorInstance } f
|
|||
import { createOrUpdateCacheFile } from '../cache-file'
|
||||
import { createOrUpdateVideoPlaylist } from '../playlist'
|
||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||
import { APVideoUpdater, getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||
import { APVideoUpdater, getOrCreateAPVideo } from '../videos'
|
||||
|
||||
async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate>) {
|
||||
const { activity, byActor } = options
|
||||
|
@ -63,7 +63,7 @@ async function processUpdateVideo (activity: ActivityUpdate) {
|
|||
return undefined
|
||||
}
|
||||
|
||||
const { video, created } = await getOrCreateVideoAndAccountAndChannel({
|
||||
const { video, created } = await getOrCreateAPVideo({
|
||||
videoObject: videoObject.id,
|
||||
allowRefresh: false,
|
||||
fetchType: 'all'
|
||||
|
@ -85,7 +85,7 @@ async function processUpdateCacheFile (byActor: MActorSignature, activity: Activ
|
|||
return undefined
|
||||
}
|
||||
|
||||
const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: cacheFileObject.object })
|
||||
const { video } = await getOrCreateAPVideo({ videoObject: cacheFileObject.object })
|
||||
|
||||
await sequelizeTypescript.transaction(async t => {
|
||||
await createOrUpdateCacheFile(cacheFileObject, video, byActor, t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue