diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-20 15:01:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-20 15:26:38 +0200 |
commit | 400043b1be38cdd7bc39462fa6a545eea0bea03e (patch) | |
tree | 68f447d00e06f80bbe84bf38dac30005e66cf2e4 /server/controllers/api/search/search-video-channels.ts | |
parent | ebe9b6b3f32d8432980854a51d28a8fb88fe62e5 (diff) | |
download | PeerTube-400043b1be38cdd7bc39462fa6a545eea0bea03e.tar.gz PeerTube-400043b1be38cdd7bc39462fa6a545eea0bea03e.tar.zst PeerTube-400043b1be38cdd7bc39462fa6a545eea0bea03e.zip |
Add ability to search by URL with query params
Diffstat (limited to 'server/controllers/api/search/search-video-channels.ts')
-rw-r--r-- | server/controllers/api/search/search-video-channels.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts index 089feed65..c9e81bffa 100644 --- a/server/controllers/api/search/search-video-channels.ts +++ b/server/controllers/api/search/search-video-channels.ts | |||
@@ -25,6 +25,7 @@ import { | |||
25 | } from '../../../middlewares' | 25 | } from '../../../middlewares' |
26 | import { VideoChannelModel } from '../../../models/video/video-channel' | 26 | import { VideoChannelModel } from '../../../models/video/video-channel' |
27 | import { MChannelAccountDefault } from '../../../types/models' | 27 | import { MChannelAccountDefault } from '../../../types/models' |
28 | import { searchLocalUrl } from './shared' | ||
28 | 29 | ||
29 | const searchChannelsRouter = express.Router() | 30 | const searchChannelsRouter = express.Router() |
30 | 31 | ||
@@ -131,7 +132,7 @@ async function searchVideoChannelURI (search: string, isWebfingerSearch: boolean | |||
131 | logger.info('Cannot search remote video channel %s.', uri, { err }) | 132 | logger.info('Cannot search remote video channel %s.', uri, { err }) |
132 | } | 133 | } |
133 | } else { | 134 | } else { |
134 | videoChannel = await VideoChannelModel.loadByUrlAndPopulateAccount(sanitizeLocalUrl(uri)) | 135 | videoChannel = await searchLocalUrl(sanitizeLocalUrl(uri), url => VideoChannelModel.loadByUrlAndPopulateAccount(url)) |
135 | } | 136 | } |
136 | 137 | ||
137 | return res.json({ | 138 | return res.json({ |