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/controllers/api/search.ts | |
parent | c56faf0d9453490737f283b29a203bb1ca632b95 (diff) | |
download | PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.tar.gz PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.tar.zst PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.zip |
Refactor getOrCreateAPVideo
Diffstat (limited to 'server/controllers/api/search.ts')
-rw-r--r-- | server/controllers/api/search.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index 77e3a024d..0cb5674c2 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import { sanitizeUrl } from '@server/helpers/core-utils' | 2 | import { sanitizeUrl } from '@server/helpers/core-utils' |
3 | import { doJSONRequest } from '@server/helpers/requests' | 3 | import { doJSONRequest } from '@server/helpers/requests' |
4 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
5 | import { getOrCreateVideoAndAccountAndChannel } from '@server/lib/activitypub/videos' | 5 | import { getOrCreateAPVideo } from '@server/lib/activitypub/videos' |
6 | import { Hooks } from '@server/lib/plugins/hooks' | 6 | import { Hooks } from '@server/lib/plugins/hooks' |
7 | import { AccountBlocklistModel } from '@server/models/account/account-blocklist' | 7 | import { AccountBlocklistModel } from '@server/models/account/account-blocklist' |
8 | import { getServerActor } from '@server/models/application/application' | 8 | import { getServerActor } from '@server/models/application/application' |
@@ -244,7 +244,7 @@ async function searchVideoURI (url: string, res: express.Response) { | |||
244 | refreshVideo: false | 244 | refreshVideo: false |
245 | } | 245 | } |
246 | 246 | ||
247 | const result = await getOrCreateVideoAndAccountAndChannel({ videoObject: url, syncParam }) | 247 | const result = await getOrCreateAPVideo({ videoObject: url, syncParam }) |
248 | video = result ? result.video : undefined | 248 | video = result ? result.video : undefined |
249 | } catch (err) { | 249 | } catch (err) { |
250 | logger.info('Cannot search remote video %s.', url, { err }) | 250 | logger.info('Cannot search remote video %s.', url, { err }) |