diff options
author | Chocobozzz <me@florianbigard.com> | 2020-03-04 16:11:21 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-03-04 16:11:21 +0100 |
commit | b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3 (patch) | |
tree | b0f2c3e0deed2be4ef77d7ab8f4a7d1bbf8ca0f3 /client | |
parent | 34102d19a1b6964cd2ec747a934e2bff3962bcce (diff) | |
download | PeerTube-b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3.tar.gz PeerTube-b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3.tar.zst PeerTube-b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3.zip |
Add ability to override search endpoint
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/search/search.service.ts | 7 |
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' | |||
11 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 11 | import { AdvancedSearch } from '@app/search/advanced-search.model' |
12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
13 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 13 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
14 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | ||
14 | 15 | ||
15 | @Injectable() | 16 | @Injectable() |
16 | export class SearchService { | 17 | export 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, |