ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix setting max channel sync in config
Chocobozzza253a8088ac4
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.htmlindex b5f31e5d96..cfd188f088 100644--- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html+++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html@@ -321,6 +321,20 @@</ng-container></my-peertube-checkbox></div>++ <div class="form-group">+ <label i18n for="videoChannelSynchronizationMaxPerUser">Max channel synchronization per user</label>++ <div class="number-with-unit">+ <input+ type="number" min="1" id="videoChannelSynchronizationMaxPerUser" class="form-control"+ formControlName="maxPerUser" [ngClass]="{ 'input-error': formErrors['import']['videoChannelSynchronization']['maxPerUser'] }"+ >+ <span i18n>{form.value['import']['videoChannelSynchronization']['maxPerUser'], plural, =1 {sync} other {syncs}}</span>+ </div>++ <div *ngIf="formErrors.import.videoChannelSynchronization.maxPerUser" class="form-error" role="alert">{{ formErrors.import.videoChannelSynchronization.maxPerUser }}</div>+ </div></ng-container></ng-container>diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.tsindex 7ef04f7576..482a665161 100644--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts@@ -16,6 +16,7 @@ import {INSTANCE_SHORT_DESCRIPTION_VALIDATOR,MAX_INSTANCE_LIVES_VALIDATOR,MAX_LIVE_DURATION_VALIDATOR,+ MAX_SYNC_PER_USER,MAX_USER_LIVES_VALIDATOR,MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR,SEARCH_INDEX_URL_VALIDATOR,@@ -182,7 +183,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {}},videoChannelSynchronization: {- enabled: null+ enabled: null,+ maxPerUser: MAX_SYNC_PER_USER+},users: {enabled: nulldiff --git a/client/src/app/core/rest/rest-extractor.service.ts b/client/src/app/core/rest/rest-extractor.service.tsindex 9541306de1..a4ccf13f66 100644--- a/client/src/app/core/rest/rest-extractor.service.ts+++ b/client/src/app/core/rest/rest-extractor.service.ts@@ -77,6 +77,7 @@ export class RestExtractor {}private buildErrorMessage (err: any) {+ console.log(err)if (err.error instanceof Error) {// A client-side or network error occurred. Handle it accordingly.const errorMessage = err.error.detail || err.error.title@@ -115,10 +116,6 @@ export class RestExtractor {.join('. ')}- if (err.error?.error) {- return err.error.error- }-if (err.status === HttpStatusCode.PAYLOAD_TOO_LARGE_413) {return $localize`Media is too large for the server. Please contact you administrator if you want to increase the limit size.`}@@ -142,6 +139,6 @@ export class RestExtractor {return $localize`Server is unavailable. Please retry later.`}- return $localize`Unknown server error`+ return err.error?.error || err.error?.detail || err.error?.title || $localize`Unknown server error`}}diff --git a/client/src/app/shared/form-validators/custom-config-validators.ts b/client/src/app/shared/form-validators/custom-config-validators.tsindex 519a1480a7..bfbdb6fcf6 100644--- a/client/src/app/shared/form-validators/custom-config-validators.ts+++ b/client/src/app/shared/form-validators/custom-config-validators.ts@@ -106,6 +106,15 @@ export const MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR: BuildFormValidator = {}}+export const MAX_SYNC_PER_USER: BuildFormValidator = {+ VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],+ MESSAGES: {+ required: $localize`Max synchronizations per user is required.`,+ min: $localize`Max synchronizations per user must be greater or equal to 1.`,+ pattern: $localize`Max synchronizations per user must be a number.`+ }+}+export const CONCURRENCY_VALIDATOR: BuildFormValidator = {VALIDATORS: [ Validators.required, Validators.min(1) ],MESSAGES: {