]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Hide wait transcoding for lives
authorChocobozzz <me@florianbigard.com>
Tue, 11 Oct 2022 12:16:15 +0000 (14:16 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 11 Oct 2022 12:17:27 +0000 (14:17 +0200)
Replays are always transcoded

client/src/app/+videos/+video-edit/shared/video-edit.component.html
client/src/app/+videos/+video-edit/shared/video-edit.component.ts
client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html
client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
client/src/app/+videos/+video-edit/video-update.component.html
client/src/app/+videos/+video-edit/video-update.component.ts

index 7be5a37363cefcfe00cad9e092669d85a41068d7..fa816fd9e9096c6ceb3b71245a01b64e7f976b6b 100644 (file)
               </ng-template>
             </my-peertube-checkbox>
 
-            <my-peertube-checkbox *ngIf="waitTranscodingEnabled" inputName="waitTranscoding" formControlName="waitTranscoding" helpPlacement="bottom-right">
+            <my-peertube-checkbox *ngIf="!hideWaitTranscoding" inputName="waitTranscoding" formControlName="waitTranscoding" helpPlacement="bottom-right">
               <ng-template ptTemplate="label">
                 <ng-container i18n>Publish after transcoding</ng-container>
               </ng-template>
index 0275f66f5db0d98d02921f092fb86b5e8ff1240f..13359a4d16c9eaa8bf28d87c7c5e642ba086e8a6 100644 (file)
@@ -22,6 +22,8 @@ import {
 import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms'
 import { InstanceService } from '@app/shared/shared-instance'
 import { VideoCaptionEdit, VideoCaptionWithPathEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
+import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { logger } from '@root-helpers/logger'
 import { PluginInfo } from '@root-helpers/plugins-manager'
 import {
   HTMLServerConfig,
@@ -33,13 +35,11 @@ import {
   VideoDetails,
   VideoPrivacy
 } from '@shared/models'
+import { VideoSource } from '@shared/models/videos/video-source'
 import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
 import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
 import { VideoCaptionEditModalContentComponent } from './video-caption-edit-modal-content/video-caption-edit-modal-content.component'
 import { VideoEditType } from './video-edit.type'
-import { VideoSource } from '@shared/models/videos/video-source'
-import { logger } from '@root-helpers/logger'
-import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 
 type VideoLanguages = VideoConstant<string> & { group?: string }
 type PluginField = {
@@ -66,7 +66,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
   @Input() videoCaptions: VideoCaptionWithPathEdit[] = []
   @Input() videoSource: VideoSource
 
-  @Input() waitTranscodingEnabled = true
+  @Input() hideWaitTranscoding = false
+
   @Input() type: VideoEditType
   @Input() liveVideo: LiveVideo
 
@@ -140,7 +141,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
       nsfw: 'false',
       commentsEnabled: this.serverConfig.defaults.publish.commentsEnabled,
       downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
-      waitTranscoding: 'true',
+      waitTranscoding: true,
       licence: this.serverConfig.defaults.publish.licence,
       tags: []
     }
index 2fb29303fe2315fdf46c1f5a8bfaf20330e1e9cd..e23fd77c701c7a2337edd4f99925fea447ffd711 100644 (file)
@@ -53,7 +53,7 @@
 <form [hidden]="!isInUpdateForm" novalidate [formGroup]="form">
   <my-video-edit
     [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
-    [forbidScheduledPublication]="true" [waitTranscodingEnabled]="isWaitTranscodingEnabled()"
+    [forbidScheduledPublication]="true" [hideWaitTranscoding]="true"
     [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo"
     type="go-live"
   ></my-video-edit>
index 4f2276e8ca0c43101c99436ede5917060f544df4..83a6b22292912dfdb972e154a3c388199d426e01 100644 (file)
@@ -160,10 +160,6 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
     return this.serverConfig.live.maxDuration / 1000
   }
 
-  isWaitTranscodingEnabled () {
-    return this.form.value['saveReplay'] === true
-  }
-
   getNormalLiveDescription () {
     if (this.isReplayAllowed()) {
       return $localize`Stream only once, replay will replace your live`
index 728884986ba2cfa33633c2a1695e1219066b8d3a..8541868c56089d7d4e49591b98b3fb9089f47139 100644 (file)
@@ -96,7 +96,7 @@
   <my-video-edit
     [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
     [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
-    [waitTranscodingEnabled]="true" [forbidScheduledPublication]="false"
+    [forbidScheduledPublication]="false"
     type="upload"
   ></my-video-edit>
 
index a33ac3db4c53f514760697cb4bbdb4f7f182a861..af564aeb0be3666c8759b71a3a4134617bfd8383 100644 (file)
@@ -9,7 +9,7 @@
     <my-video-edit
       [form]="form" [formErrors]="formErrors" [forbidScheduledPublication]="forbidScheduledPublication"
       [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
-      [videoCaptions]="videoCaptions" [waitTranscodingEnabled]="isWaitTranscodingEnabled()"
+      [videoCaptions]="videoCaptions" [hideWaitTranscoding]="isWaitTranscodingHidden()"
       type="update" (pluginFieldsAdded)="hydratePluginFieldsFromVideo()"
       [liveVideo]="liveVideo" [videoToUpdate]="videoDetails"
       [videoSource]="videoSource"
index 21297144705197402c1cfebc929441018a254214..02398a0360c1674a5bb50c34f1e87d26c6cef0bf 100644 (file)
@@ -28,7 +28,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
 
   isUpdatingVideo = false
   forbidScheduledPublication = false
-  waitTranscodingEnabled = true
 
   private updateDone = false
 
@@ -96,16 +95,12 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
     return { canDeactivate: this.formChanged === false, text }
   }
 
-  isWaitTranscodingEnabled () {
+  isWaitTranscodingHidden () {
     if (this.videoDetails.getFiles().length > 1) { // Already transcoded
-      return false
+      return true
     }
 
-    if (this.liveVideo && this.form.value['saveReplay'] !== true) {
-      return false
-    }
-
-    return true
+    return false
   }
 
   async update () {