1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Refactor getOrCreateAPVideo

This commit is contained in:
Chocobozzz 2021-06-02 15:47:05 +02:00
parent c56faf0d94
commit 304a84d59c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
19 changed files with 243 additions and 209 deletions

View file

@ -2,7 +2,7 @@ import * as express from 'express'
import { sanitizeUrl } from '@server/helpers/core-utils'
import { doJSONRequest } from '@server/helpers/requests'
import { CONFIG } from '@server/initializers/config'
import { getOrCreateVideoAndAccountAndChannel } from '@server/lib/activitypub/videos'
import { getOrCreateAPVideo } from '@server/lib/activitypub/videos'
import { Hooks } from '@server/lib/plugins/hooks'
import { AccountBlocklistModel } from '@server/models/account/account-blocklist'
import { getServerActor } from '@server/models/application/application'
@ -244,7 +244,7 @@ async function searchVideoURI (url: string, res: express.Response) {
refreshVideo: false
}
const result = await getOrCreateVideoAndAccountAndChannel({ videoObject: url, syncParam })
const result = await getOrCreateAPVideo({ videoObject: url, syncParam })
video = result ? result.video : undefined
} catch (err) {
logger.info('Cannot search remote video %s.', url, { err })