From b0e769bbf6745c8fbc5a72b8cd30b754dc0395c3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Mar 2020 16:11:21 +0100 Subject: Add ability to override search endpoint --- client/src/app/search/search.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client/src/app') 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' import { AdvancedSearch } from '@app/search/advanced-search.model' import { VideoChannel } from '@app/shared/video-channel/video-channel.model' import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' +import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' @Injectable() export class SearchService { @@ -21,7 +22,11 @@ export class SearchService { private restExtractor: RestExtractor, private restService: RestService, private videoService: VideoService - ) {} + ) { + // Add ability to override search endpoint if the user updated this local storage key + const searchUrl = peertubeLocalStorage.getItem('search-url') + if (searchUrl) SearchService.BASE_SEARCH_URL = searchUrl + } searchVideos (parameters: { search: string, -- cgit v1.2.3