diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/shared/shared-video-miniature | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
4 files changed, 23 insertions, 23 deletions
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts index d8b2ee17d..f12ae2ee5 100644 --- a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts | |||
@@ -42,7 +42,7 @@ enum GroupDate { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | @Directive() | 44 | @Directive() |
45 | // tslint:disable-next-line: directive-class-suffix | 45 | // eslint-disable-next-line @angular-eslint/directive-class-suffix |
46 | export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterContentInit, DisableForReuseHook { | 46 | export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterContentInit, DisableForReuseHook { |
47 | @ViewChild('videoListHeader', { static: true, read: ViewContainerRef }) videoListHeader: ViewContainerRef | 47 | @ViewChild('videoListHeader', { static: true, read: ViewContainerRef }) videoListHeader: ViewContainerRef |
48 | 48 | ||
@@ -174,7 +174,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte | |||
174 | ngAfterContentInit () { | 174 | ngAfterContentInit () { |
175 | if (this.videoListHeader) { | 175 | if (this.videoListHeader) { |
176 | // some components don't use the header: they use their own template, like my-history.component.html | 176 | // some components don't use the header: they use their own template, like my-history.component.html |
177 | this.setHeader.apply(this, [ this.HeaderComponent, this.headerComponentInjector ]) | 177 | this.setHeader(this.HeaderComponent, this.headerComponentInjector) |
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
@@ -278,7 +278,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte | |||
278 | 278 | ||
279 | if (currentGroupedDate !== period.value) { | 279 | if (currentGroupedDate !== period.value) { |
280 | currentGroupedDate = period.value | 280 | currentGroupedDate = period.value |
281 | this.groupedDates[ video.id ] = currentGroupedDate | 281 | this.groupedDates[video.id] = currentGroupedDate |
282 | } | 282 | } |
283 | 283 | ||
284 | break | 284 | break |
@@ -302,13 +302,13 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte | |||
302 | i: Injector = this.headerComponentInjector | 302 | i: Injector = this.headerComponentInjector |
303 | ) { | 303 | ) { |
304 | const injector = i || Injector.create({ | 304 | const injector = i || Injector.create({ |
305 | providers: [{ | 305 | providers: [ { |
306 | provide: 'data', | 306 | provide: 'data', |
307 | useValue: { | 307 | useValue: { |
308 | titlePage: this.titlePage, | 308 | titlePage: this.titlePage, |
309 | titleTooltip: this.titleTooltip | 309 | titleTooltip: this.titleTooltip |
310 | } | 310 | } |
311 | }] | 311 | } ] |
312 | }) | 312 | }) |
313 | const viewContainerRef = this.videoListHeader | 313 | const viewContainerRef = this.videoListHeader |
314 | viewContainerRef.clear() | 314 | viewContainerRef.clear() |
@@ -331,9 +331,9 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, AfterConte | |||
331 | protected loadPageRouteParams (_queryParams: Params) { /* empty */ } | 331 | protected loadPageRouteParams (_queryParams: Params) { /* empty */ } |
332 | 332 | ||
333 | protected loadRouteParams (queryParams: Params) { | 333 | protected loadRouteParams (queryParams: Params) { |
334 | this.sort = queryParams[ 'sort' ] as VideoSortField || this.defaultSort | 334 | this.sort = queryParams['sort'] as VideoSortField || this.defaultSort |
335 | this.categoryOneOf = queryParams[ 'categoryOneOf' ] | 335 | this.categoryOneOf = queryParams['categoryOneOf'] |
336 | this.angularState = queryParams[ 'a-state' ] | 336 | this.angularState = queryParams['a-state'] |
337 | 337 | ||
338 | this.loadPageRouteParams(queryParams) | 338 | this.loadPageRouteParams(queryParams) |
339 | } | 339 | } |
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 28fefb9dd..5328f5170 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 | |||
@@ -210,10 +210,10 @@ export class VideoDownloadComponent { | |||
210 | 210 | ||
211 | private getMetadataFormat (format: any) { | 211 | private getMetadataFormat (format: any) { |
212 | const keyToTranslateFunction = { | 212 | const keyToTranslateFunction = { |
213 | 'encoder': (value: string) => ({ label: $localize`Encoder`, value }), | 213 | encoder: (value: string) => ({ label: $localize`Encoder`, value }), |
214 | 'format_long_name': (value: string) => ({ label: $localize`Format name`, value }), | 214 | format_long_name: (value: string) => ({ label: $localize`Format name`, value }), |
215 | 'size': (value: number) => ({ label: $localize`Size`, value: this.bytesPipe.transform(value, 2) }), | 215 | size: (value: number) => ({ label: $localize`Size`, value: this.bytesPipe.transform(value, 2) }), |
216 | 'bit_rate': (value: number) => ({ | 216 | bit_rate: (value: number) => ({ |
217 | label: $localize`Bitrate`, | 217 | label: $localize`Bitrate`, |
218 | value: `${this.numbersPipe.transform(value)}bps` | 218 | value: `${this.numbersPipe.transform(value)}bps` |
219 | }) | 219 | }) |
@@ -234,9 +234,9 @@ export class VideoDownloadComponent { | |||
234 | if (!stream) return undefined | 234 | if (!stream) return undefined |
235 | 235 | ||
236 | let keyToTranslateFunction = { | 236 | let keyToTranslateFunction = { |
237 | 'codec_long_name': (value: string) => ({ label: $localize`Codec`, value }), | 237 | codec_long_name: (value: string) => ({ label: $localize`Codec`, value }), |
238 | 'profile': (value: string) => ({ label: $localize`Profile`, value }), | 238 | profile: (value: string) => ({ label: $localize`Profile`, value }), |
239 | 'bit_rate': (value: number) => ({ | 239 | bit_rate: (value: number) => ({ |
240 | label: $localize`Bitrate`, | 240 | label: $localize`Bitrate`, |
241 | value: `${this.numbersPipe.transform(value)}bps` | 241 | value: `${this.numbersPipe.transform(value)}bps` |
242 | }) | 242 | }) |
@@ -244,15 +244,15 @@ export class VideoDownloadComponent { | |||
244 | 244 | ||
245 | if (type === 'video') { | 245 | if (type === 'video') { |
246 | keyToTranslateFunction = Object.assign(keyToTranslateFunction, { | 246 | keyToTranslateFunction = Object.assign(keyToTranslateFunction, { |
247 | 'width': (value: number) => ({ label: $localize`Resolution`, value: `${value}x${stream.height}` }), | 247 | width: (value: number) => ({ label: $localize`Resolution`, value: `${value}x${stream.height}` }), |
248 | 'display_aspect_ratio': (value: string) => ({ label: $localize`Aspect ratio`, value }), | 248 | display_aspect_ratio: (value: string) => ({ label: $localize`Aspect ratio`, value }), |
249 | 'avg_frame_rate': (value: string) => ({ label: $localize`Average frame rate`, value }), | 249 | avg_frame_rate: (value: string) => ({ label: $localize`Average frame rate`, value }), |
250 | 'pix_fmt': (value: string) => ({ label: $localize`Pixel format`, value }) | 250 | pix_fmt: (value: string) => ({ label: $localize`Pixel format`, value }) |
251 | }) | 251 | }) |
252 | } else { | 252 | } else { |
253 | keyToTranslateFunction = Object.assign(keyToTranslateFunction, { | 253 | keyToTranslateFunction = Object.assign(keyToTranslateFunction, { |
254 | 'sample_rate': (value: number) => ({ label: $localize`Sample rate`, value }), | 254 | sample_rate: (value: number) => ({ label: $localize`Sample rate`, value }), |
255 | 'channel_layout': (value: number) => ({ label: $localize`Channel Layout`, value }) | 255 | channel_layout: (value: number) => ({ label: $localize`Channel Layout`, value }) |
256 | }) | 256 | }) |
257 | } | 257 | } |
258 | 258 | ||
diff --git a/client/src/app/shared/shared-video-miniature/video-list-header.component.ts b/client/src/app/shared/shared-video-miniature/video-list-header.component.ts index 08a961be1..fed696672 100644 --- a/client/src/app/shared/shared-video-miniature/video-list-header.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-list-header.component.ts | |||
@@ -11,7 +11,7 @@ export abstract class GenericHeaderComponent { | |||
11 | 11 | ||
12 | @Component({ | 12 | @Component({ |
13 | selector: 'my-video-list-header', | 13 | selector: 'my-video-list-header', |
14 | // tslint:disable-next-line:use-component-view-encapsulation | 14 | // eslint-disable-next-line @angular-eslint/use-component-view-encapsulation |
15 | encapsulation: ViewEncapsulation.None, | 15 | encapsulation: ViewEncapsulation.None, |
16 | templateUrl: './video-list-header.component.html' | 16 | templateUrl: './video-list-header.component.html' |
17 | }) | 17 | }) |
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts index d64ee9b98..456b36926 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts | |||
@@ -108,7 +108,7 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni | |||
108 | } | 108 | } |
109 | 109 | ||
110 | isInSelectionMode () { | 110 | isInSelectionMode () { |
111 | return Object.keys(this._selection).some(k => this._selection[ k ] === true) | 111 | return Object.keys(this._selection).some(k => this._selection[k] === true) |
112 | } | 112 | } |
113 | 113 | ||
114 | generateSyndicationList () { | 114 | generateSyndicationList () { |