Add ability to override search endpoint
This commit is contained in:
parent
34102d19a1
commit
b0e769bbf6
|
@ -11,6 +11,7 @@ import { Video } from '@app/shared/video/video.model'
|
||||||
import { AdvancedSearch } from '@app/search/advanced-search.model'
|
import { AdvancedSearch } from '@app/search/advanced-search.model'
|
||||||
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
|
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
|
||||||
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
|
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
|
||||||
|
import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SearchService {
|
export class SearchService {
|
||||||
|
@ -21,7 +22,11 @@ export class SearchService {
|
||||||
private restExtractor: RestExtractor,
|
private restExtractor: RestExtractor,
|
||||||
private restService: RestService,
|
private restService: RestService,
|
||||||
private videoService: VideoService
|
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: {
|
searchVideos (parameters: {
|
||||||
search: string,
|
search: string,
|
||||||
|
|
Loading…
Reference in New Issue