diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-14 17:17:01 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-14 17:17:01 +0100 |
commit | 3cf68b869decf07ff7435fe1436d4f3134df1bf4 (patch) | |
tree | 836efe5ddc626fef3ba4c96269efbca305f46256 /client/src/app/+videos/+video-edit | |
parent | a6f919e455f2c6ae8f2194da4aa66824a6bfd09e (diff) | |
download | PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.gz PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.zst PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.zip |
Ability for admins to set default upload values
Diffstat (limited to 'client/src/app/+videos/+video-edit')
6 files changed, 8 insertions, 13 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index 39767f258..2bec933e9 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts | |||
@@ -110,9 +110,10 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
110 | updateForm () { | 110 | updateForm () { |
111 | const defaultValues: any = { | 111 | const defaultValues: any = { |
112 | nsfw: 'false', | 112 | nsfw: 'false', |
113 | commentsEnabled: 'true', | 113 | commentsEnabled: this.serverConfig.defaults.publish.commentsEnabled, |
114 | downloadEnabled: 'true', | 114 | downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled, |
115 | waitTranscoding: 'true', | 115 | waitTranscoding: 'true', |
116 | licence: this.serverConfig.defaults.publish.licence, | ||
116 | tags: [] | 117 | tags: [] |
117 | } | 118 | } |
118 | const obj: any = { | 119 | const obj: any = { |
@@ -160,6 +161,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
160 | } | 161 | } |
161 | 162 | ||
162 | ngOnInit () { | 163 | ngOnInit () { |
164 | this.serverConfig = this.serverService.getHTMLConfig() | ||
165 | |||
163 | this.updateForm() | 166 | this.updateForm() |
164 | 167 | ||
165 | this.pluginService.ensurePluginsAreLoaded('video-edit') | 168 | this.pluginService.ensurePluginsAreLoaded('video-edit') |
@@ -200,8 +203,6 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
200 | } | 203 | } |
201 | }) | 204 | }) |
202 | 205 | ||
203 | this.serverConfig = this.serverService.getHTMLConfig() | ||
204 | |||
205 | this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) | 206 | this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) |
206 | 207 | ||
207 | this.ngZone.runOutsideAngular(() => { | 208 | this.ngZone.runOutsideAngular(() => { |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts index 01eabb0d7..46a7ebb0b 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts | |||
@@ -70,8 +70,6 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView | |||
70 | privacy: this.highestPrivacy, | 70 | privacy: this.highestPrivacy, |
71 | nsfw: this.serverConfig.instance.isNSFW, | 71 | nsfw: this.serverConfig.instance.isNSFW, |
72 | waitTranscoding: true, | 72 | waitTranscoding: true, |
73 | commentsEnabled: true, | ||
74 | downloadEnabled: true, | ||
75 | permanentLive: this.firstStepPermanentLive, | 73 | permanentLive: this.firstStepPermanentLive, |
76 | saveReplay: this.firstStepPermanentLive === false && this.isReplayAllowed(), | 74 | saveReplay: this.firstStepPermanentLive === false && this.isReplayAllowed(), |
77 | channelId: this.firstStepChannelId | 75 | channelId: this.firstStepChannelId |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts index 87e47683f..5e758910e 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts | |||
@@ -81,8 +81,6 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af | |||
81 | const videoUpdate: VideoUpdate = { | 81 | const videoUpdate: VideoUpdate = { |
82 | privacy: this.highestPrivacy, | 82 | privacy: this.highestPrivacy, |
83 | waitTranscoding: false, | 83 | waitTranscoding: false, |
84 | commentsEnabled: true, | ||
85 | downloadEnabled: true, | ||
86 | channelId: this.firstStepChannelId | 84 | channelId: this.firstStepChannelId |
87 | } | 85 | } |
88 | 86 | ||
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts index 3487c1adf..2ea70ed55 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts | |||
@@ -68,8 +68,6 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV | |||
68 | const videoUpdate: VideoUpdate = { | 68 | const videoUpdate: VideoUpdate = { |
69 | privacy: this.highestPrivacy, | 69 | privacy: this.highestPrivacy, |
70 | waitTranscoding: false, | 70 | waitTranscoding: false, |
71 | commentsEnabled: true, | ||
72 | downloadEnabled: true, | ||
73 | channelId: this.firstStepChannelId | 71 | channelId: this.firstStepChannelId |
74 | } | 72 | } |
75 | 73 | ||
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts index efa8c85a3..5e086ef42 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts | |||
@@ -49,7 +49,9 @@ export abstract class VideoSend extends FormReactive implements OnInit { | |||
49 | this.serverService.getVideoPrivacies() | 49 | this.serverService.getVideoPrivacies() |
50 | .subscribe( | 50 | .subscribe( |
51 | privacies => { | 51 | privacies => { |
52 | const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies) | 52 | const defaultPrivacy = this.serverConfig.defaults.publish.privacy |
53 | |||
54 | const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies, defaultPrivacy) | ||
53 | 55 | ||
54 | this.videoPrivacies = videoPrivacies | 56 | this.videoPrivacies = videoPrivacies |
55 | this.firstStepPrivacyId = defaultPrivacyId | 57 | this.firstStepPrivacyId = defaultPrivacyId |
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index 28d7ec458..76f154249 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts | |||
@@ -277,8 +277,6 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy | |||
277 | private uploadFile (file: File, previewfile?: File) { | 277 | private uploadFile (file: File, previewfile?: File) { |
278 | const metadata = { | 278 | const metadata = { |
279 | waitTranscoding: true, | 279 | waitTranscoding: true, |
280 | commentsEnabled: true, | ||
281 | downloadEnabled: true, | ||
282 | channelId: this.firstStepChannelId, | 280 | channelId: this.firstStepChannelId, |
283 | nsfw: this.serverConfig.instance.isNSFW, | 281 | nsfw: this.serverConfig.instance.isNSFW, |
284 | privacy: this.highestPrivacy.toString(), | 282 | privacy: this.highestPrivacy.toString(), |