Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix client lint

Chocobozzz7dcd7d81406f
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts
index 25203de1b4..460c37a38e 100644
--- a/client/src/app/+videos/+video-edit/video-add.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add.component.ts
@@ -143,7 +143,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate {
return text
}
- canDeactivate (): { canDeactivate: boolean, text?: string} {
+ canDeactivate (): { canDeactivate: boolean, text?: string } {
if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate()
if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate()
if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate()
diff --git a/client/src/app/core/routing/preload-selected-modules-list.ts b/client/src/app/core/routing/preload-selected-modules-list.ts
index b5c3195b01..1abcdb0151 100644
--- a/client/src/app/core/routing/preload-selected-modules-list.ts
+++ b/client/src/app/core/routing/preload-selected-modules-list.ts
@@ -1,13 +1,13 @@
import { Observable, of as ofObservable, timer as observableTimer } from 'rxjs'
import { switchMap } from 'rxjs/operators'
-import { PreloadingStrategy, Route } from '@angular/router'
import { Injectable } from '@angular/core'
+import { PreloadingStrategy, Route } from '@angular/router'
@Injectable()
export class PreloadSelectedModulesList implements PreloadingStrategy {
preload (route: Route, load: () => Observable<any>): Observable<any> {
- if (!route.data || !route.data.preload) return ofObservable(null)
+ if (!route.data?.preload) return ofObservable(null)
if (typeof route.data.preload === 'number') {
return observableTimer(route.data.preload).pipe(switchMap(() => load()))
diff --git a/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts
index 7c18b7f676..e0cb475fc5 100644
--- a/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts
+++ b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts
@@ -13,11 +13,11 @@ export class NumberFormatterPipe implements PipeTransform {
static getDecimalForNumber (x: number, n = 1) {
const v = x.toString().split('.')
const f = v[1] || ''
- if (f.length > n) return +f.substr(0, n)
+ if (f.length > n) return +f.substring(0, n)
return +f
}
- private dictionary: Array<{max: number, type: string}> = [
+ private dictionary: Array<{ max: number, type: string }> = [
{ max: 1000, type: '' },
{ max: 1000000, type: 'K' },
{ max: 1000000000, type: 'M' }
diff --git a/client/src/app/shared/shared-main/misc/list-overflow.component.ts b/client/src/app/shared/shared-main/misc/list-overflow.component.ts
index 7e4e1b1d1b..b6ce216410 100644
--- a/client/src/app/shared/shared-main/misc/list-overflow.component.ts
+++ b/client/src/app/shared/shared-main/misc/list-overflow.component.ts
@@ -32,7 +32,7 @@ export interface ListOverflowItem {
})
export class ListOverflowComponent<T extends ListOverflowItem> implements AfterViewInit {
@Input() items: T[]
- @Input() itemTemplate: TemplateRef<{item: T}>
+ @Input() itemTemplate: TemplateRef<{ item: T }>
@ViewChild('modal', { static: true }) modal: ElementRef
@ViewChild('itemsParent', { static: true }) parent: ElementRef<HTMLDivElement>
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts
index 667cb107f0..4135542dc5 100644
--- a/client/src/app/shared/shared-video-miniature/video-download.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts
@@ -10,7 +10,7 @@ import { VideoCaption, VideoFile, VideoPrivacy } from '@shared/models'
import { BytesPipe, NumberFormatterPipe, VideoDetails, VideoFileTokenService, VideoService } from '../shared-main'
type DownloadType = 'video' | 'subtitles'
-type FileMetadata = { [key: string]: { label: string, value: string }}
+type FileMetadata = { [key: string]: { label: string, value: string } }
@Component({
selector: 'my-video-download',
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
index 7a25743454..79b7b9a506 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
@@ -74,7 +74,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
}
buildRouterQuery () {
- if (!this.playlistElement || !this.playlistElement.video) return {}
+ if (!this.playlistElement?.video) return {}
return {
playlistPosition: this.playlistElement.position,
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts
index 7e25e3067d..ffbe644088 100644
--- a/client/src/assets/player/utils.ts
+++ b/client/src/assets/player/utils.ts
@@ -32,7 +32,7 @@ function isSafari () {
// https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts
// Don't import all Angular stuff, just copy the code with shame
-const dictionaryBytes: Array<{max: number, type: string}> = [
+const dictionaryBytes: Array<{ max: number, type: string }> = [
{ max: 1024, type: 'B' },
{ max: 1048576, type: 'KB' },
{ max: 1073741824, type: 'MB' },
diff --git a/client/src/standalone/videos/shared/playlist-tracker.ts b/client/src/standalone/videos/shared/playlist-tracker.ts
index 9ea4be83f4..d8708826d1 100644
--- a/client/src/standalone/videos/shared/playlist-tracker.ts
+++ b/client/src/standalone/videos/shared/playlist-tracker.ts
@@ -32,7 +32,7 @@ export class PlaylistTracker {
const next = this.playlistElements.find(e => e.position === position)
- if (!next || !next.video) {
+ if (!next?.video) {
return this.getNextPlaylistElement(position + 1)
}
@@ -52,7 +52,7 @@ export class PlaylistTracker {
const prev = this.playlistElements.find(e => e.position === position)
- if (!prev || !prev.video) {
+ if (!prev?.video) {
return this.getNextPlaylistElement(position - 1)
}
@@ -68,7 +68,7 @@ export class PlaylistTracker {
setPosition (position: number) {
this.currentPlaylistElement = this.playlistElements.find(e => e.position === position)
- if (!this.currentPlaylistElement || !this.currentPlaylistElement.video) {
+ if (!this.currentPlaylistElement?.video) {
logger.error('Current playlist element is not valid.', this.currentPlaylistElement)
this.currentPlaylistElement = this.getNextPlaylistElement()
}
diff --git a/client/src/standalone/videos/tsconfig.json b/client/src/standalone/videos/tsconfig.json
index e0cab7ca3c..7d532985c4 100644
--- a/client/src/standalone/videos/tsconfig.json
+++ b/client/src/standalone/videos/tsconfig.json
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfig.json",
"include": [
- "src/standalone/videos/embed.ts",
- "src/standalone/videos/test-embed.ts"
+ "./embed.ts",
+ "./test-embed.ts"
]
}