diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 11:27:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:01:45 +0200 |
commit | 1378c0d343028f3d40d7d795422684ab9e6a1599 (patch) | |
tree | 08062b84a38a7e2dfe0aa674e7ca8e1b7321044e /client/src/app/shared/shared-video-playlist | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/shared/shared-video-playlist')
-rw-r--r-- | client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | 51 | ||||
-rw-r--r-- | client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | 16 |
2 files changed, 31 insertions, 36 deletions
diff --git a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts index 7069fa8fd..df3aeddb7 100644 --- a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | |||
@@ -198,15 +198,16 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
198 | privacy: VideoPlaylistPrivacy.PRIVATE | 198 | privacy: VideoPlaylistPrivacy.PRIVATE |
199 | } | 199 | } |
200 | 200 | ||
201 | this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate).subscribe( | 201 | this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate) |
202 | () => { | 202 | .subscribe({ |
203 | this.isNewPlaylistBlockOpened = false | 203 | next: () => { |
204 | this.isNewPlaylistBlockOpened = false | ||
204 | 205 | ||
205 | this.cd.markForCheck() | 206 | this.cd.markForCheck() |
206 | }, | 207 | }, |
207 | 208 | ||
208 | err => this.notifier.error(err.message) | 209 | error: err => this.notifier.error(err.message) |
209 | ) | 210 | }) |
210 | } | 211 | } |
211 | 212 | ||
212 | onVideoPlaylistSearchChanged () { | 213 | onVideoPlaylistSearchChanged () { |
@@ -268,17 +269,15 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
268 | } | 269 | } |
269 | 270 | ||
270 | this.videoPlaylistService.updateVideoOfPlaylist(playlist.id, element.playlistElementId, body, this.video.id) | 271 | this.videoPlaylistService.updateVideoOfPlaylist(playlist.id, element.playlistElementId, body, this.video.id) |
271 | .subscribe( | 272 | .subscribe({ |
272 | () => { | 273 | next: () => { |
273 | this.notifier.success($localize`Timestamps updated`) | 274 | this.notifier.success($localize`Timestamps updated`) |
274 | }, | 275 | }, |
275 | 276 | ||
276 | err => { | 277 | error: err => this.notifier.error(err.message), |
277 | this.notifier.error(err.message) | ||
278 | }, | ||
279 | 278 | ||
280 | () => this.cd.markForCheck() | 279 | complete: () => this.cd.markForCheck() |
281 | ) | 280 | }) |
282 | } | 281 | } |
283 | 282 | ||
284 | private isOptionalRowDisplayed (playlist: PlaylistSummary) { | 283 | private isOptionalRowDisplayed (playlist: PlaylistSummary) { |
@@ -302,17 +301,15 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
302 | 301 | ||
303 | private removeVideoFromPlaylist (playlist: PlaylistSummary, elementId: number) { | 302 | private removeVideoFromPlaylist (playlist: PlaylistSummary, elementId: number) { |
304 | this.videoPlaylistService.removeVideoFromPlaylist(playlist.id, elementId, this.video.id) | 303 | this.videoPlaylistService.removeVideoFromPlaylist(playlist.id, elementId, this.video.id) |
305 | .subscribe( | 304 | .subscribe({ |
306 | () => { | 305 | next: () => { |
307 | this.notifier.success($localize`Video removed from ${playlist.displayName}`) | 306 | this.notifier.success($localize`Video removed from ${playlist.displayName}`) |
308 | }, | 307 | }, |
309 | 308 | ||
310 | err => { | 309 | error: err => this.notifier.error(err.message), |
311 | this.notifier.error(err.message) | ||
312 | }, | ||
313 | 310 | ||
314 | () => this.cd.markForCheck() | 311 | complete: () => this.cd.markForCheck() |
315 | ) | 312 | }) |
316 | } | 313 | } |
317 | 314 | ||
318 | private listenToVideoPlaylistChange () { | 315 | private listenToVideoPlaylistChange () { |
@@ -371,8 +368,8 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
371 | if (element.stopTimestamp && element.stopTimestamp !== this.video.duration) body.stopTimestamp = element.stopTimestamp | 368 | if (element.stopTimestamp && element.stopTimestamp !== this.video.duration) body.stopTimestamp = element.stopTimestamp |
372 | 369 | ||
373 | this.videoPlaylistService.addVideoInPlaylist(playlist.id, body) | 370 | this.videoPlaylistService.addVideoInPlaylist(playlist.id, body) |
374 | .subscribe( | 371 | .subscribe({ |
375 | res => { | 372 | next: res => { |
376 | const message = body.startTimestamp || body.stopTimestamp | 373 | const message = body.startTimestamp || body.stopTimestamp |
377 | ? $localize`Video added in ${playlist.displayName} at timestamps ${this.formatTimestamp(element)}` | 374 | ? $localize`Video added in ${playlist.displayName} at timestamps ${this.formatTimestamp(element)}` |
378 | : $localize`Video added in ${playlist.displayName}` | 375 | : $localize`Video added in ${playlist.displayName}` |
@@ -382,12 +379,10 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
382 | if (element) element.playlistElementId = res.videoPlaylistElement.id | 379 | if (element) element.playlistElementId = res.videoPlaylistElement.id |
383 | }, | 380 | }, |
384 | 381 | ||
385 | err => { | 382 | error: err => this.notifier.error(err.message), |
386 | this.notifier.error(err.message) | ||
387 | }, | ||
388 | 383 | ||
389 | () => this.cd.markForCheck() | 384 | complete: () => this.cd.markForCheck() |
390 | ) | 385 | }) |
391 | } | 386 | } |
392 | 387 | ||
393 | private formatTimestamp (element: PlaylistElement) { | 388 | private formatTimestamp (element: PlaylistElement) { |
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 2e495ec26..8d1e14f94 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 | |||
@@ -88,14 +88,14 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
88 | const videoId = this.playlistElement.video ? this.playlistElement.video.id : undefined | 88 | const videoId = this.playlistElement.video ? this.playlistElement.video.id : undefined |
89 | 89 | ||
90 | this.videoPlaylistService.removeVideoFromPlaylist(this.playlist.id, playlistElement.id, videoId) | 90 | this.videoPlaylistService.removeVideoFromPlaylist(this.playlist.id, playlistElement.id, videoId) |
91 | .subscribe( | 91 | .subscribe({ |
92 | () => { | 92 | next: () => { |
93 | this.notifier.success($localize`Video removed from ${this.playlist.displayName}`) | 93 | this.notifier.success($localize`Video removed from ${this.playlist.displayName}`) |
94 | this.elementRemoved.emit(playlistElement) | 94 | this.elementRemoved.emit(playlistElement) |
95 | }, | 95 | }, |
96 | 96 | ||
97 | err => this.notifier.error(err.message) | 97 | error: err => this.notifier.error(err.message) |
98 | ) | 98 | }) |
99 | 99 | ||
100 | this.moreDropdown.close() | 100 | this.moreDropdown.close() |
101 | } | 101 | } |
@@ -107,8 +107,8 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
107 | body.stopTimestamp = this.timestampOptions.stopTimestampEnabled ? this.timestampOptions.stopTimestamp : null | 107 | body.stopTimestamp = this.timestampOptions.stopTimestampEnabled ? this.timestampOptions.stopTimestamp : null |
108 | 108 | ||
109 | this.videoPlaylistService.updateVideoOfPlaylist(this.playlist.id, playlistElement.id, body, this.playlistElement.video.id) | 109 | this.videoPlaylistService.updateVideoOfPlaylist(this.playlist.id, playlistElement.id, body, this.playlistElement.video.id) |
110 | .subscribe( | 110 | .subscribe({ |
111 | () => { | 111 | next: () => { |
112 | this.notifier.success($localize`Timestamps updated`) | 112 | this.notifier.success($localize`Timestamps updated`) |
113 | 113 | ||
114 | playlistElement.startTimestamp = body.startTimestamp | 114 | playlistElement.startTimestamp = body.startTimestamp |
@@ -117,8 +117,8 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
117 | this.cdr.detectChanges() | 117 | this.cdr.detectChanges() |
118 | }, | 118 | }, |
119 | 119 | ||
120 | err => this.notifier.error(err.message) | 120 | error: err => this.notifier.error(err.message) |
121 | ) | 121 | }) |
122 | 122 | ||
123 | this.moreDropdown.close() | 123 | this.moreDropdown.close() |
124 | } | 124 | } |