aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-03-04 16:11:21 +0100
committerChocobozzz <me@florianbigard.com>2020-03-04 16:11:21 +0100
commitb0e769bbf6745c8fbc5a72b8cd30b754dc0395c3 (patch)
treeb0f2c3e0deed2be4ef77d7ab8f4a7d1bbf8ca0f3 /client/src
parent34102d19a1b6964cd2ec747a934e2bff3962bcce (diff)
downloadPeerTube-b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3.tar.gz
PeerTube-b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3.tar.zst
PeerTube-b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3.zip
Add ability to override search endpoint
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/search/search.service.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/search/search.service.ts b/client/src/app/search/search.service.ts
index 7610fee8c..3cad5aaa7 100644
--- a/client/src/app/search/search.service.ts
+++ b/client/src/app/search/search.service.ts
@@ -11,6 +11,7 @@ import { Video } from '@app/shared/video/video.model'
11import { AdvancedSearch } from '@app/search/advanced-search.model' 11import { AdvancedSearch } from '@app/search/advanced-search.model'
12import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 12import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
13import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 13import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
14import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
14 15
15@Injectable() 16@Injectable()
16export class SearchService { 17export class SearchService {
@@ -21,7 +22,11 @@ export class SearchService {
21 private restExtractor: RestExtractor, 22 private restExtractor: RestExtractor,
22 private restService: RestService, 23 private restService: RestService,
23 private videoService: VideoService 24 private videoService: VideoService
24 ) {} 25 ) {
26 // Add ability to override search endpoint if the user updated this local storage key
27 const searchUrl = peertubeLocalStorage.getItem('search-url')
28 if (searchUrl) SearchService.BASE_SEARCH_URL = searchUrl
29 }
25 30
26 searchVideos (parameters: { 31 searchVideos (parameters: {
27 search: string, 32 search: string,