From b3ed044ded4ed3108a3ff459e6600b71fa53568a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Nov 2021 13:52:46 +0100 Subject: Simplify search video channel --- server/controllers/api/search/search-video-channels.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts index aa5afb46e..d615ff9ed 100644 --- a/server/controllers/api/search/search-video-channels.ts +++ b/server/controllers/api/search/search-video-channels.ts @@ -56,7 +56,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) { if (parts.length === 3 && parts[0].length === 0) parts.shift() const isWebfingerSearch = parts.length === 2 && parts.every(p => p && !p.includes(' ')) - if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res) + if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, res) // @username -> username to search in DB if (search.startsWith('@')) query.search = search.replace(/^@/, '') @@ -110,11 +110,11 @@ async function searchVideoChannelsDB (query: VideoChannelsSearchQueryAfterSaniti return res.json(getFormattedObjects(resultList.data, resultList.total)) } -async function searchVideoChannelURI (search: string, isWebfingerSearch: boolean, res: express.Response) { +async function searchVideoChannelURI (search: string, res: express.Response) { let videoChannel: MChannelAccountDefault let uri = search - if (isWebfingerSearch) { + if (!isURISearch(search)) { try { uri = await loadActorUrlOrGetFromWebfinger(search) } catch (err) { -- cgit v1.2.3