aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-15 15:58:10 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 10:08:55 +0100
commita9bfa85d2cdf13670aaced740da5b493fbeddfce (patch)
tree3781c9218d4cc7786b6589365c0efbed2151703d /client/src/app/shared
parentc77fdc605b3ccc1ab6890f889d8200fbe9372949 (diff)
downloadPeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.gz
PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.zst
PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.zip
Add ability for admins to set default p2p policy
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-search/search.service.ts7
-rw-r--r--client/src/app/shared/shared-user-settings/user-video-settings.component.html2
-rw-r--r--client/src/app/shared/shared-user-settings/user-video-settings.component.ts8
3 files changed, 6 insertions, 11 deletions
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'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' 5import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core'
6import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' 6import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
7import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
8import { 7import {
9 ResultList, 8 ResultList,
10 Video as VideoServerModel, 9 Video as VideoServerModel,
@@ -25,11 +24,7 @@ export class SearchService {
25 private restService: RestService, 24 private restService: RestService,
26 private videoService: VideoService, 25 private videoService: VideoService,
27 private playlistService: VideoPlaylistService 26 private playlistService: VideoPlaylistService
28 ) { 27 ) { }
29 // Add ability to override search endpoint if the user updated this local storage key
30 const searchUrl = peertubeLocalStorage.getItem('search-url')
31 if (searchUrl) SearchService.BASE_SEARCH_URL = searchUrl
32 }
33 28
34 searchVideos (parameters: { 29 searchVideos (parameters: {
35 search?: string 30 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 @@
38 38
39 <div class="form-group"> 39 <div class="form-group">
40 <my-peertube-checkbox 40 <my-peertube-checkbox
41 inputName="webTorrentEnabled" formControlName="webTorrentEnabled" [recommended]="true" 41 inputName="p2pEnabled" formControlName="p2pEnabled" [recommended]="true"
42 i18n-labelText labelText="Help share videos being played" 42 i18n-labelText labelText="Help share videos being played"
43 > 43 >
44 <ng-container ngProjectAs="description"> 44 <ng-container ngProjectAs="description">
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,
34 ngOnInit () { 34 ngOnInit () {
35 this.buildForm({ 35 this.buildForm({
36 nsfwPolicy: null, 36 nsfwPolicy: null,
37 webTorrentEnabled: null, 37 p2pEnabled: null,
38 autoPlayVideo: null, 38 autoPlayVideo: null,
39 autoPlayNextVideo: null, 39 autoPlayNextVideo: null,
40 videoLanguages: null 40 videoLanguages: null
@@ -48,7 +48,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit,
48 48
49 this.form.patchValue({ 49 this.form.patchValue({
50 nsfwPolicy: this.user.nsfwPolicy || this.defaultNSFWPolicy, 50 nsfwPolicy: this.user.nsfwPolicy || this.defaultNSFWPolicy,
51 webTorrentEnabled: this.user.webTorrentEnabled, 51 p2pEnabled: this.user.p2pEnabled,
52 autoPlayVideo: this.user.autoPlayVideo === true, 52 autoPlayVideo: this.user.autoPlayVideo === true,
53 autoPlayNextVideo: this.user.autoPlayNextVideo, 53 autoPlayNextVideo: this.user.autoPlayNextVideo,
54 videoLanguages: this.user.videoLanguages 54 videoLanguages: this.user.videoLanguages
@@ -65,7 +65,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit,
65 65
66 updateDetails (onlyKeys?: string[]) { 66 updateDetails (onlyKeys?: string[]) {
67 const nsfwPolicy = this.form.value['nsfwPolicy'] 67 const nsfwPolicy = this.form.value['nsfwPolicy']
68 const webTorrentEnabled = this.form.value['webTorrentEnabled'] 68 const p2pEnabled = this.form.value['p2pEnabled']
69 const autoPlayVideo = this.form.value['autoPlayVideo'] 69 const autoPlayVideo = this.form.value['autoPlayVideo']
70 const autoPlayNextVideo = this.form.value['autoPlayNextVideo'] 70 const autoPlayNextVideo = this.form.value['autoPlayNextVideo']
71 71
@@ -80,7 +80,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit,
80 80
81 let details: UserUpdateMe = { 81 let details: UserUpdateMe = {
82 nsfwPolicy, 82 nsfwPolicy,
83 webTorrentEnabled, 83 p2pEnabled,
84 autoPlayVideo, 84 autoPlayVideo,
85 autoPlayNextVideo, 85 autoPlayNextVideo,
86 videoLanguages 86 videoLanguages