aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/search/search-video-channels.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/search/search-video-channels.ts')
-rw-r--r--server/controllers/api/search/search-video-channels.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts
index be0b6b9a2..9fc2d53a5 100644
--- a/server/controllers/api/search/search-video-channels.ts
+++ b/server/controllers/api/search/search-video-channels.ts
@@ -46,7 +46,7 @@ export { searchChannelsRouter }
46 46
47function searchVideoChannels (req: express.Request, res: express.Response) { 47function searchVideoChannels (req: express.Request, res: express.Response) {
48 const query: VideoChannelsSearchQuery = req.query 48 const query: VideoChannelsSearchQuery = req.query
49 const search = query.search 49 let search = query.search || ''
50 50
51 const parts = search.split('@') 51 const parts = search.split('@')
52 52
@@ -57,7 +57,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) {
57 if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res) 57 if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res)
58 58
59 // @username -> username to search in DB 59 // @username -> username to search in DB
60 if (query.search.startsWith('@')) query.search = query.search.replace(/^@/, '') 60 if (search.startsWith('@')) search = search.replace(/^@/, '')
61 61
62 if (isSearchIndexSearch(query)) { 62 if (isSearchIndexSearch(query)) {
63 return searchVideoChannelsIndex(query, res) 63 return searchVideoChannelsIndex(query, res)
@@ -99,7 +99,8 @@ async function searchVideoChannelsDB (query: VideoChannelsSearchQuery, res: expr
99 start: query.start, 99 start: query.start,
100 count: query.count, 100 count: query.count,
101 sort: query.sort, 101 sort: query.sort,
102 host: query.host 102 host: query.host,
103 names: query.names
103 }, 'filter:api.search.video-channels.local.list.params') 104 }, 'filter:api.search.video-channels.local.list.params')
104 105
105 const resultList = await Hooks.wrapPromiseFun( 106 const resultList = await Hooks.wrapPromiseFun(