From: Chocobozzz Date: Mon, 14 Jan 2019 10:52:15 +0000 (+0100) Subject: Add error message when trying to upload .ass subtitles X-Git-Tag: v1.2.0-rc.1~18 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b5487ff4a5c0bb2acaca79ee00df26a83886c889;p=oweals%2Fpeertube.git Add error message when trying to upload .ass subtitles --- diff --git a/client/src/app/shared/forms/reactive-file.component.ts b/client/src/app/shared/forms/reactive-file.component.ts index c3986838f..f60c38e8d 100644 --- a/client/src/app/shared/forms/reactive-file.component.ts +++ b/client/src/app/shared/forms/reactive-file.component.ts @@ -53,6 +53,17 @@ export class ReactiveFileComponent implements OnInit, ControlValueAccessor { return } + const extension = '.' + file.name.split('.').pop() + if (this.extensions.includes(extension) === false) { + const message = this.i18n( + 'PeerTube cannot handle this kind of file. Accepted extensions are {{extensions}}.', + { extensions: this.allowedExtensionsMessage } + ) + this.notifier.error(message) + + return + } + this.file = file this.propagateChange(this.file)