From 9df52d660feb722404be00a50f3c8a612bec1c15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 14:42:53 +0200 Subject: Migrate client to eslint --- .../+video-edit/shared/i18n-primeng-calendar.service.ts | 2 +- .../+video-edit/shared/video-caption-add-modal.component.ts | 8 ++++---- client/src/app/+videos/+video-edit/shared/video-edit-utils.ts | 2 +- .../src/app/+videos/+video-edit/shared/video-edit.component.ts | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'client/src/app/+videos/+video-edit/shared') diff --git a/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts index 34848b036..4b201ac74 100644 --- a/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts +++ b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts @@ -73,7 +73,7 @@ export class I18nPrimengCalendarService { } getTimezone () { - const gmt = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1] + const gmt = new Date().toString().match(/([A-Z]+[+-][0-9]+)/)[1] const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone return `${timezone} - ${gmt}` diff --git a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts index 875911b91..98d66ff00 100644 --- a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts @@ -66,18 +66,18 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni isReplacingExistingCaption () { if (this.closingModal === true) return false - const languageId = this.form.value[ 'language' ] + const languageId = this.form.value['language'] - return languageId && this.existingCaptions.indexOf(languageId) !== -1 + return languageId && this.existingCaptions.includes(languageId) } async addCaption () { - const languageId = this.form.value[ 'language' ] + const languageId = this.form.value['language'] const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId) this.captionAdded.emit({ language: languageObject, - captionfile: this.form.value[ 'captionfile' ] + captionfile: this.form.value['captionfile'] }) this.hide() diff --git a/client/src/app/+videos/+video-edit/shared/video-edit-utils.ts b/client/src/app/+videos/+video-edit/shared/video-edit-utils.ts index 3a7dbed36..db1ef8d73 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit-utils.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit-utils.ts @@ -24,7 +24,7 @@ function hydrateFormFromVideo (formGroup: FormGroup, video: VideoEdit, thumbnail .then(response => response.blob()) .then(data => { formGroup.patchValue({ - [ obj.name ]: data + [obj.name]: data }) }) } 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 90a0e8f52..366c93a79 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 @@ -233,7 +233,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { async deleteCaption (caption: VideoCaptionEdit) { // Caption recovers his former state - if (caption.action && this.initialVideoCaptions.indexOf(caption.language.id) !== -1) { + if (caption.action && this.initialVideoCaptions.includes(caption.language.id)) { caption.action = undefined return } @@ -297,7 +297,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { private trackPrivacyChange () { // We will update the schedule input and the wait transcoding checkbox validators - this.form.controls[ 'privacy' ] + this.form.controls['privacy'] .valueChanges .pipe(map(res => parseInt(res.toString(), 10))) .subscribe( @@ -336,12 +336,12 @@ export class VideoEditComponent implements OnInit, OnDestroy { private trackChannelChange () { // We will update the "support" field depending on the channel - this.form.controls[ 'channelId' ] + this.form.controls['channelId'] .valueChanges .pipe(map(res => parseInt(res.toString(), 10))) .subscribe( newChannelId => { - const oldChannelId = parseInt(this.form.value[ 'channelId' ], 10) + const oldChannelId = parseInt(this.form.value['channelId'], 10) // Not initialized yet if (isNaN(newChannelId)) return @@ -350,7 +350,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { // Wait support field update setTimeout(() => { - const currentSupport = this.form.value[ 'support' ] + const currentSupport = this.form.value['support'] // First time we set the channel? if (isNaN(oldChannelId)) { -- cgit v1.2.3