aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/search/search-videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-20 15:01:17 +0200
committerChocobozzz <me@florianbigard.com>2021-10-20 15:26:38 +0200
commit400043b1be38cdd7bc39462fa6a545eea0bea03e (patch)
tree68f447d00e06f80bbe84bf38dac30005e66cf2e4 /server/controllers/api/search/search-videos.ts
parentebe9b6b3f32d8432980854a51d28a8fb88fe62e5 (diff)
downloadPeerTube-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-videos.ts')
-rw-r--r--server/controllers/api/search/search-videos.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/controllers/api/search/search-videos.ts b/server/controllers/api/search/search-videos.ts
index eb7ce0841..90946cb74 100644
--- a/server/controllers/api/search/search-videos.ts
+++ b/server/controllers/api/search/search-videos.ts
@@ -25,6 +25,7 @@ import {
25} from '../../../middlewares' 25} from '../../../middlewares'
26import { VideoModel } from '../../../models/video/video' 26import { VideoModel } from '../../../models/video/video'
27import { MVideoAccountLightBlacklistAllFiles } from '../../../types/models' 27import { MVideoAccountLightBlacklistAllFiles } from '../../../types/models'
28import { searchLocalUrl } from './shared'
28 29
29const searchVideosRouter = express.Router() 30const searchVideosRouter = express.Router()
30 31
@@ -141,7 +142,7 @@ async function searchVideoURI (url: string, res: express.Response) {
141 logger.info('Cannot search remote video %s.', url, { err }) 142 logger.info('Cannot search remote video %s.', url, { err })
142 } 143 }
143 } else { 144 } else {
144 video = await VideoModel.loadByUrlAndPopulateAccount(sanitizeLocalUrl(url)) 145 video = await searchLocalUrl(sanitizeLocalUrl(url), url => VideoModel.loadByUrlAndPopulateAccount(url))
145 } 146 }
146 147
147 return res.json({ 148 return res.json({