aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/search/search-video-channels.ts5
-rw-r--r--server/controllers/api/search/search-video-playlists.ts5
-rw-r--r--server/controllers/api/search/search-videos.ts5
3 files changed, 9 insertions, 6 deletions
diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts
index d615ff9ed..1d2a9d235 100644
--- a/server/controllers/api/search/search-video-channels.ts
+++ b/server/controllers/api/search/search-video-channels.ts
@@ -1,9 +1,10 @@
1import express from 'express' 1import express from 'express'
2import { sanitizeUrl } from '@server/helpers/core-utils' 2import { sanitizeUrl } from '@server/helpers/core-utils'
3import { pickSearchChannelQuery } from '@server/helpers/query' 3import { pickSearchChannelQuery } from '@server/helpers/query'
4import { doJSONRequest, findLatestRedirection } from '@server/helpers/requests' 4import { doJSONRequest } from '@server/helpers/requests'
5import { CONFIG } from '@server/initializers/config' 5import { CONFIG } from '@server/initializers/config'
6import { WEBSERVER } from '@server/initializers/constants' 6import { WEBSERVER } from '@server/initializers/constants'
7import { findLatestAPRedirection } from '@server/lib/activitypub/activity'
7import { Hooks } from '@server/lib/plugins/hooks' 8import { Hooks } from '@server/lib/plugins/hooks'
8import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' 9import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
9import { getServerActor } from '@server/models/application/application' 10import { getServerActor } from '@server/models/application/application'
@@ -126,7 +127,7 @@ async function searchVideoChannelURI (search: string, res: express.Response) {
126 127
127 if (isUserAbleToSearchRemoteURI(res)) { 128 if (isUserAbleToSearchRemoteURI(res)) {
128 try { 129 try {
129 const latestUri = await findLatestRedirection(uri, { activityPub: true }) 130 const latestUri = await findLatestAPRedirection(uri)
130 131
131 const actor = await getOrCreateAPActor(latestUri, 'all', true, true) 132 const actor = await getOrCreateAPActor(latestUri, 'all', true, true)
132 videoChannel = actor.VideoChannel 133 videoChannel = actor.VideoChannel
diff --git a/server/controllers/api/search/search-video-playlists.ts b/server/controllers/api/search/search-video-playlists.ts
index e76d65fde..97aeeaba9 100644
--- a/server/controllers/api/search/search-video-playlists.ts
+++ b/server/controllers/api/search/search-video-playlists.ts
@@ -3,10 +3,11 @@ import { sanitizeUrl } from '@server/helpers/core-utils'
3import { isUserAbleToSearchRemoteURI } from '@server/helpers/express-utils' 3import { isUserAbleToSearchRemoteURI } from '@server/helpers/express-utils'
4import { logger } from '@server/helpers/logger' 4import { logger } from '@server/helpers/logger'
5import { pickSearchPlaylistQuery } from '@server/helpers/query' 5import { pickSearchPlaylistQuery } from '@server/helpers/query'
6import { doJSONRequest, findLatestRedirection } from '@server/helpers/requests' 6import { doJSONRequest } from '@server/helpers/requests'
7import { getFormattedObjects } from '@server/helpers/utils' 7import { getFormattedObjects } from '@server/helpers/utils'
8import { CONFIG } from '@server/initializers/config' 8import { CONFIG } from '@server/initializers/config'
9import { WEBSERVER } from '@server/initializers/constants' 9import { WEBSERVER } from '@server/initializers/constants'
10import { findLatestAPRedirection } from '@server/lib/activitypub/activity'
10import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get' 11import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get'
11import { Hooks } from '@server/lib/plugins/hooks' 12import { Hooks } from '@server/lib/plugins/hooks'
12import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' 13import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
@@ -105,7 +106,7 @@ async function searchVideoPlaylistsURI (search: string, res: express.Response) {
105 106
106 if (isUserAbleToSearchRemoteURI(res)) { 107 if (isUserAbleToSearchRemoteURI(res)) {
107 try { 108 try {
108 const url = await findLatestRedirection(search, { activityPub: true }) 109 const url = await findLatestAPRedirection(search)
109 110
110 videoPlaylist = await getOrCreateAPVideoPlaylist(url) 111 videoPlaylist = await getOrCreateAPVideoPlaylist(url)
111 } catch (err) { 112 } catch (err) {
diff --git a/server/controllers/api/search/search-videos.ts b/server/controllers/api/search/search-videos.ts
index d0ab7f12a..b33064335 100644
--- a/server/controllers/api/search/search-videos.ts
+++ b/server/controllers/api/search/search-videos.ts
@@ -1,9 +1,10 @@
1import express from 'express' 1import express from 'express'
2import { sanitizeUrl } from '@server/helpers/core-utils' 2import { sanitizeUrl } from '@server/helpers/core-utils'
3import { pickSearchVideoQuery } from '@server/helpers/query' 3import { pickSearchVideoQuery } from '@server/helpers/query'
4import { doJSONRequest, findLatestRedirection } from '@server/helpers/requests' 4import { doJSONRequest } from '@server/helpers/requests'
5import { CONFIG } from '@server/initializers/config' 5import { CONFIG } from '@server/initializers/config'
6import { WEBSERVER } from '@server/initializers/constants' 6import { WEBSERVER } from '@server/initializers/constants'
7import { findLatestAPRedirection } from '@server/lib/activitypub/activity'
7import { getOrCreateAPVideo } from '@server/lib/activitypub/videos' 8import { getOrCreateAPVideo } from '@server/lib/activitypub/videos'
8import { Hooks } from '@server/lib/plugins/hooks' 9import { Hooks } from '@server/lib/plugins/hooks'
9import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' 10import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
@@ -141,7 +142,7 @@ async function searchVideoURI (url: string, res: express.Response) {
141 } 142 }
142 143
143 const result = await getOrCreateAPVideo({ 144 const result = await getOrCreateAPVideo({
144 videoObject: await findLatestRedirection(url, { activityPub: true }), 145 videoObject: await findLatestAPRedirection(url),
145 syncParam 146 syncParam
146 }) 147 })
147 video = result ? result.video : undefined 148 video = result ? result.video : undefined