1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 11:59:58 +02:00

Add ability to update torrents cache in client

This commit is contained in:
Chocobozzz 2021-02-18 11:07:08 +01:00 committed by Chocobozzz
parent d9a2a03196
commit b3d5cb92b1
12 changed files with 41 additions and 4 deletions

View file

@ -38,6 +38,20 @@
<div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div>
</div>
<div class="form-group" formGroupName="torrents">
<label i18n for="cacheTorrentsSize">Number of video torrents to keep in cache</label>
<div class="number-with-unit">
<input
type="number" min="0" id="cacheTorrentsSize" class="form-control"
formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.torrents.size'] }"
>
<span i18n>{getCacheSize('torrents'), plural, =1 {cached torrent} other {cached torrents}}</span>
</div>
<div *ngIf="formErrors.cache.torrents.size" class="form-error">{{ formErrors.cache.torrents.size }}</div>
</div>
</ng-container>
</div>

View file

@ -12,7 +12,7 @@ export class EditAdvancedConfigurationComponent {
@Input() form: FormGroup
@Input() formErrors: any
getCacheSize (type: 'captions' | 'previews') {
getCacheSize (type: 'captions' | 'previews' | 'torrents') {
return this.form.value['cache'][type]['size']
}
}

View file

@ -105,6 +105,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
},
captions: {
size: CACHE_CAPTIONS_SIZE_VALIDATOR
},
torrents: {
size: CACHE_CAPTIONS_SIZE_VALIDATOR
}
},
signup: {