From a9bfa85d2cdf13670aaced740da5b493fbeddfce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Dec 2021 15:58:10 +0100 Subject: Add ability for admins to set default p2p policy --- client/src/app/shared/shared-search/search.service.ts | 7 +------ .../shared-user-settings/user-video-settings.component.html | 2 +- .../shared/shared-user-settings/user-video-settings.component.ts | 8 ++++---- 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-search/search.service.ts b/client/src/app/shared/shared-search/search.service.ts index 61acfb466..ad2de0f37 100644 --- a/client/src/app/shared/shared-search/search.service.ts +++ b/client/src/app/shared/shared-search/search.service.ts @@ -4,7 +4,6 @@ import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' -import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' import { ResultList, Video as VideoServerModel, @@ -25,11 +24,7 @@ export class SearchService { private restService: RestService, private videoService: VideoService, private playlistService: VideoPlaylistService - ) { - // 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 diff --git a/client/src/app/shared/shared-user-settings/user-video-settings.component.html b/client/src/app/shared/shared-user-settings/user-video-settings.component.html index bc9dd0f7f..4843f65b9 100644 --- a/client/src/app/shared/shared-user-settings/user-video-settings.component.html +++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.html @@ -38,7 +38,7 @@
diff --git a/client/src/app/shared/shared-user-settings/user-video-settings.component.ts b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts index 0cd889a8a..7d6b69469 100644 --- a/client/src/app/shared/shared-user-settings/user-video-settings.component.ts +++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts @@ -34,7 +34,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit, ngOnInit () { this.buildForm({ nsfwPolicy: null, - webTorrentEnabled: null, + p2pEnabled: null, autoPlayVideo: null, autoPlayNextVideo: null, videoLanguages: null @@ -48,7 +48,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit, this.form.patchValue({ nsfwPolicy: this.user.nsfwPolicy || this.defaultNSFWPolicy, - webTorrentEnabled: this.user.webTorrentEnabled, + p2pEnabled: this.user.p2pEnabled, autoPlayVideo: this.user.autoPlayVideo === true, autoPlayNextVideo: this.user.autoPlayNextVideo, videoLanguages: this.user.videoLanguages @@ -65,7 +65,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit, updateDetails (onlyKeys?: string[]) { const nsfwPolicy = this.form.value['nsfwPolicy'] - const webTorrentEnabled = this.form.value['webTorrentEnabled'] + const p2pEnabled = this.form.value['p2pEnabled'] const autoPlayVideo = this.form.value['autoPlayVideo'] const autoPlayNextVideo = this.form.value['autoPlayNextVideo'] @@ -80,7 +80,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit, let details: UserUpdateMe = { nsfwPolicy, - webTorrentEnabled, + p2pEnabled, autoPlayVideo, autoPlayNextVideo, videoLanguages -- cgit v1.2.3