From 1378c0d343028f3d40d7d795422684ab9e6a1599 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 11:27:47 +0200 Subject: Fix client lint --- .../video-go-live.component.ts | 59 ++++++++--------- .../video-import-torrent.component.ts | 75 +++++++++++----------- .../video-import-url.component.ts | 18 +++--- .../video-add-components/video-upload.component.ts | 8 +-- .../+videos/+video-edit/video-update.component.ts | 63 +++++++++--------- .../shared/action-buttons/video-rate.component.ts | 16 ++--- .../shared/comment/video-comment-add.component.ts | 8 +-- .../shared/comment/video-comment.component.ts | 8 +-- .../shared/comment/video-comments.component.ts | 42 ++++++------ .../shared/metadata/video-description.component.ts | 10 +-- .../playlist/video-watch-playlist.component.ts | 15 +++-- .../recommended-videos.component.ts | 14 ++-- .../+videos/+video-watch/video-watch.component.ts | 16 ++--- .../overview/video-overview.component.ts | 8 +-- .../video-user-subscriptions.component.ts | 8 +-- 15 files changed, 187 insertions(+), 181 deletions(-) (limited to 'client/src/app/+videos') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts index db25dc6be..30c79594d 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts @@ -8,7 +8,7 @@ import { FormValidatorService } from '@app/shared/shared-forms' import { Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' import { LiveVideoService } from '@app/shared/shared-video-live' import { LoadingBarService } from '@ngx-loading-bar/core' -import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, PeerTubeProblemDocument, ServerErrorCode, VideoPrivacy } from '@shared/models' +import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' import { VideoSend } from './video-send' @Component({ @@ -74,33 +74,34 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView const toPatch = Object.assign({}, video, { privacy: this.firstStepPrivacyId }) this.form.patchValue(toPatch) - this.liveVideoService.goLive(video).subscribe( - res => { - this.videoId = res.video.id - this.videoUUID = res.video.uuid - this.isInUpdateForm = true + this.liveVideoService.goLive(video) + .subscribe({ + next: res => { + this.videoId = res.video.id + this.videoUUID = res.video.uuid + this.isInUpdateForm = true - this.firstStepDone.emit(name) + this.firstStepDone.emit(name) - this.fetchVideoLive() - }, + this.fetchVideoLive() + }, + + error: err => { + this.firstStepError.emit() - err => { - this.firstStepError.emit() + let message = err.message - let message = err.message + const error = err.body as PeerTubeProblemDocument - const error = err.body as PeerTubeProblemDocument + if (error?.code === ServerErrorCode.MAX_INSTANCE_LIVES_LIMIT_REACHED) { + message = $localize`Cannot create live because this instance have too many created lives` + } else if (error?.code === ServerErrorCode.MAX_USER_LIVES_LIMIT_REACHED) { + message = $localize`Cannot create live because you created too many lives` + } - if (error?.code === ServerErrorCode.MAX_INSTANCE_LIVES_LIMIT_REACHED) { - message = $localize`Cannot create live because this instance have too many created lives` - } else if (error?.code === ServerErrorCode.MAX_USER_LIVES_LIMIT_REACHED) { - message = $localize`Cannot create live because you created too many lives` + this.notifier.error(message) } - - this.notifier.error(message) - } - ) + }) } updateSecondStep () { @@ -123,19 +124,19 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView this.updateVideoAndCaptions(video), this.liveVideoService.updateLive(this.videoId, liveVideoUpdate) - ]).subscribe( - () => { + ]).subscribe({ + next: () => { this.notifier.success($localize`Live published.`) this.router.navigateByUrl(Video.buildWatchUrl(video)) }, - err => { + error: err => { this.error = err.message scrollToTop() console.error(err) } - ) + }) } getMaxLiveDuration () { @@ -148,15 +149,15 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView private fetchVideoLive () { this.liveVideoService.getVideoLive(this.videoId) - .subscribe( - liveVideo => { + .subscribe({ + next: liveVideo => { this.liveVideo = liveVideo }, - err => { + error: err => { this.firstStepError.emit() this.notifier.error(err.message) } - ) + }) } } diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts index 62aaeb019..fef1f5d65 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts @@ -88,40 +88,41 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af this.loadingBar.useRef().start() - this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate).subscribe( - res => { - this.loadingBar.useRef().complete() - this.firstStepDone.emit(res.video.name) - this.isImportingVideo = false - this.hasImportedVideo = true - - this.video = new VideoEdit(Object.assign(res.video, { - commentsEnabled: videoUpdate.commentsEnabled, - downloadEnabled: videoUpdate.downloadEnabled, - privacy: { id: this.firstStepPrivacyId }, - support: null, - thumbnailUrl: null, - previewUrl: null - })) - - hydrateFormFromVideo(this.form, this.video, false) - }, - - err => { - this.loadingBar.useRef().complete() - this.isImportingVideo = false - this.firstStepError.emit() - - let message = err.message - - const error = err.body as PeerTubeProblemDocument - if (error?.code === ServerErrorCode.INCORRECT_FILES_IN_TORRENT) { - message = $localize`Torrents with only 1 file are supported.` - } + this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate) + .subscribe({ + next: res => { + this.loadingBar.useRef().complete() + this.firstStepDone.emit(res.video.name) + this.isImportingVideo = false + this.hasImportedVideo = true + + this.video = new VideoEdit(Object.assign(res.video, { + commentsEnabled: videoUpdate.commentsEnabled, + downloadEnabled: videoUpdate.downloadEnabled, + privacy: { id: this.firstStepPrivacyId }, + support: null, + thumbnailUrl: null, + previewUrl: null + })) + + hydrateFormFromVideo(this.form, this.video, false) + }, + + error: err => { + this.loadingBar.useRef().complete() + this.isImportingVideo = false + this.firstStepError.emit() + + let message = err.message + + const error = err.body as PeerTubeProblemDocument + if (error?.code === ServerErrorCode.INCORRECT_FILES_IN_TORRENT) { + message = $localize`Torrents with only 1 file are supported.` + } - this.notifier.error(message) - } - ) + this.notifier.error(message) + } + }) } updateSecondStep () { @@ -135,19 +136,19 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af // Update the video this.updateVideoAndCaptions(this.video) - .subscribe( - () => { + .subscribe({ + next: () => { this.isUpdatingVideo = false this.notifier.success($localize`Video to import updated.`) this.router.navigate([ '/my-library', 'video-imports' ]) }, - err => { + error: err => { this.error = err.message scrollToTop() console.error(err) } - ) + }) } } diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts index 3243b4d38..e1893b28f 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts @@ -6,7 +6,7 @@ import { getAbsoluteAPIUrl, scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' -import { VideoPrivacy, VideoUpdate } from '@shared/models' +import { VideoUpdate } from '@shared/models' import { hydrateFormFromVideo } from '../shared/video-edit-utils' import { VideoSend } from './video-send' @@ -86,8 +86,8 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV ) }) ) - .subscribe( - ({ video, videoCaptions }) => { + .subscribe({ + next: ({ video, videoCaptions }) => { this.loadingBar.useRef().complete() this.firstStepDone.emit(video.name) this.isImportingVideo = false @@ -117,13 +117,13 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV hydrateFormFromVideo(this.form, this.video, true) }, - err => { + error: err => { this.loadingBar.useRef().complete() this.isImportingVideo = false this.firstStepError.emit() this.notifier.error(err.message) } - ) + }) } updateSecondStep () { @@ -137,19 +137,19 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV // Update the video this.updateVideoAndCaptions(this.video) - .subscribe( - () => { + .subscribe({ + next: () => { this.isUpdatingVideo = false this.notifier.success($localize`Video to import updated.`) this.router.navigate([ '/my-library', 'video-imports' ]) }, - err => { + error: err => { this.error = err.message scrollToTop() console.error(err) } - ) + }) } } diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index 189bc9669..b8cb4fa1e 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -240,8 +240,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy this.isUpdatingVideo = true this.updateVideoAndCaptions(video) - .subscribe( - () => { + .subscribe({ + next: () => { this.isUpdatingVideo = false this.isUploadingVideo = false @@ -249,12 +249,12 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy this.router.navigateByUrl(Video.buildWatchUrl(video)) }, - err => { + error: err => { this.error = err.message scrollToTop() console.error(err) } - ) + }) } private getInputVideoFile () { diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index 1534eee82..95336dc75 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts @@ -47,34 +47,35 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { this.route.data .pipe(map(data => data.videoData)) - .subscribe(({ video, videoChannels, videoCaptions, liveVideo }) => { - this.video = new VideoEdit(video) - this.videoDetails = video - - this.userVideoChannels = videoChannels - this.videoCaptions = videoCaptions - this.liveVideo = liveVideo - - this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE - - // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout - setTimeout(() => { - hydrateFormFromVideo(this.form, this.video, true) - - if (this.liveVideo) { - this.form.patchValue({ - saveReplay: this.liveVideo.saveReplay, - permanentLive: this.liveVideo.permanentLive - }) - } - }) - }, + .subscribe({ + next: ({ video, videoChannels, videoCaptions, liveVideo }) => { + this.video = new VideoEdit(video) + this.videoDetails = video + + this.userVideoChannels = videoChannels + this.videoCaptions = videoCaptions + this.liveVideo = liveVideo + + this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE + + // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout + setTimeout(() => { + hydrateFormFromVideo(this.form, this.video, true) + + if (this.liveVideo) { + this.form.patchValue({ + saveReplay: this.liveVideo.saveReplay, + permanentLive: this.liveVideo.permanentLive + }) + } + }) + }, - err => { - console.error(err) - this.notifier.error(err.message) - } - ) + error: err => { + console.error(err) + this.notifier.error(err.message) + } + }) } @HostListener('window:beforeunload', [ '$event' ]) @@ -150,8 +151,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { return this.liveVideoService.updateLive(this.video.id, liveVideoUpdate) }) ) - .subscribe( - () => { + .subscribe({ + next: () => { this.updateDone = true this.isUpdatingVideo = false this.loadingBar.useRef().complete() @@ -159,13 +160,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { this.router.navigateByUrl(Video.buildWatchUrl(this.video)) }, - err => { + error: err => { this.loadingBar.useRef().complete() this.isUpdatingVideo = false this.notifier.error(err.message) console.error(err) } - ) + }) } hydratePluginFieldsFromVideo () { diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts index ecb5a9281..48d48f33f 100644 --- a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts +++ b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts @@ -90,16 +90,16 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy { if (this.isUserLoggedIn === false) return this.videoService.getUserVideoRating(this.video.id) - .subscribe( - ratingObject => { + .subscribe({ + next: ratingObject => { if (!ratingObject) return this.userRating = ratingObject.rating this.userRatingLoaded.emit(this.userRating) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } private setRating (nextRating: UserVideoRateType) { @@ -110,16 +110,16 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy { } ratingMethods[nextRating].call(this.videoService, this.video.id) - .subscribe( - () => { + .subscribe({ + next: () => { // Update the video like attribute this.updateVideoRating(this.userRating, nextRating) this.userRating = nextRating this.rateUpdated.emit(this.userRating) }, - (err: { message: string }) => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } private updateVideoRating (oldRating: UserVideoRateType, newRating: UserVideoRateType) { diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts index 78efe1684..ac65f7260 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts @@ -137,19 +137,19 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, obs = this.addCommentThread(commentCreate) } - obs.subscribe( - comment => { + obs.subscribe({ + next: comment => { this.addingComment = false this.commentCreated.emit(comment) this.form.reset() }, - err => { + error: err => { this.addingComment = false this.notifier.error(err.text) } - ) + }) } isAddButtonDisplayed () { diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts index 0e1c4c207..f858f4750 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.ts @@ -149,11 +149,11 @@ export class VideoCommentComponent implements OnInit, OnChanges { const user = this.authService.getUser() if (user.hasRight(UserRight.MANAGE_USERS)) { this.userService.getUserWithCache(account.userId) - .subscribe( - user => this.commentUser = user, + .subscribe({ + next: user => this.commentUser = user, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } } diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts index 2c39e63fb..72866b874 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts @@ -90,22 +90,22 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { 'filter:api.video-watch.video-thread-replies.list.result' ) - obs.subscribe( - res => { - this.threadComments[commentId] = res - this.threadLoading[commentId] = false - this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) + obs.subscribe({ + next: res => { + this.threadComments[commentId] = res + this.threadLoading[commentId] = false + this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) - if (highlightThread) { - this.highlightedThread = new VideoComment(res.comment) + if (highlightThread) { + this.highlightedThread = new VideoComment(res.comment) - // Scroll to the highlighted thread - setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) - } - }, + // Scroll to the highlighted thread + setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) + } + }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } loadMoreThreads () { @@ -123,8 +123,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { 'filter:api.video-watch.video-threads.list.result' ) - obs.subscribe( - res => { + obs.subscribe({ + next: res => { this.comments = this.comments.concat(res.data) this.componentPagination.totalItems = res.total this.totalNotDeletedComments = res.totalNotDeletedComments @@ -133,8 +133,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } onCommentThreadCreated (comment: VideoComment) { @@ -181,8 +181,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { if (res === false) return false this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) - .subscribe( - () => { + .subscribe({ + next: () => { if (this.highlightedThread?.id === commentToDelete.id) { commentToDelete = this.comments.find(c => c.id === commentToDelete.id) @@ -193,8 +193,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { this.softDeleteComment(commentToDelete) }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) return true } diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts b/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts index 870c7ae3f..e002b3c22 100644 --- a/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts +++ b/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts @@ -50,8 +50,8 @@ export class VideoDescriptionComponent implements OnChanges { this.descriptionLoading = true this.videoService.loadCompleteDescription(this.video.descriptionPath) - .subscribe( - description => { + .subscribe({ + next: description => { this.completeDescriptionShown = true this.descriptionLoading = false @@ -61,11 +61,11 @@ export class VideoDescriptionComponent implements OnChanges { this.updateVideoDescription(this.completeVideoDescription) }, - error => { + error: err => { this.descriptionLoading = false - this.notifier.error(error.message) + this.notifier.error(err.message) } - ) + }) } onTimestampClicked (timestamp: number) { diff --git a/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts b/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts index 8b3ed4964..f0f7966b1 100644 --- a/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts +++ b/client/src/app/+videos/+video-watch/shared/playlist/video-watch-playlist.component.ts @@ -1,4 +1,3 @@ - import { Component, EventEmitter, Input, Output } from '@angular/core' import { Router } from '@angular/router' import { AuthService, ComponentPagination, LocalStorageService, Notifier, SessionStorageService, UserService } from '@app/core' @@ -196,12 +195,14 @@ export class VideoWatchPlaylistComponent { autoPlayNextVideoPlaylist: this.autoPlayNextVideoPlaylist } - this.userService.updateMyProfile(details).subscribe( - () => { - this.auth.refreshUserInformation() - }, - err => this.notifier.error(err.message) - ) + this.userService.updateMyProfile(details) + .subscribe({ + next: () => { + this.auth.refreshUserInformation() + }, + + error: err => this.notifier.error(err.message) + }) } } diff --git a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.ts b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.ts index 89b9c01b6..7f3703c08 100644 --- a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.ts +++ b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.ts @@ -84,12 +84,14 @@ export class RecommendedVideosComponent implements OnInit, OnChanges { autoPlayNextVideo: this.autoPlayNextVideo } - this.userService.updateMyProfile(details).subscribe( - () => { - this.authService.refreshUserInformation() - }, - err => this.notifier.error(err.message) - ) + this.userService.updateMyProfile(details) + .subscribe({ + next: () => { + this.authService.refreshUserInformation() + }, + + error: err => this.notifier.error(err.message) + }) } } } diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index ccb9c5e71..85100b653 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -238,8 +238,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { ) forkJoin([ videoObs, this.videoCaptionService.listCaptions(videoId)]) - .subscribe( - ([ video, captionsResult ]) => { + .subscribe({ + next: ([ video, captionsResult ]) => { const queryParams = this.route.snapshot.queryParams const urlOptions = { @@ -260,23 +260,23 @@ export class VideoWatchComponent implements OnInit, OnDestroy { .catch(err => this.handleGlobalError(err)) }, - err => this.handleRequestError(err) - ) + error: err => this.handleRequestError(err) + }) } private loadPlaylist (playlistId: string) { if (this.isSameElement(this.playlist, playlistId)) return this.playlistService.getVideoPlaylist(playlistId) - .subscribe( - playlist => { + .subscribe({ + next: playlist => { this.playlist = playlist this.videoWatchPlaylist.loadPlaylistElements(playlist, !this.playlistPosition, this.playlistPosition) }, - err => this.handleRequestError(err) - ) + error: err => this.handleRequestError(err) + }) } private isSameElement (element: VideoDetails | VideoPlaylist, newId: string) { diff --git a/client/src/app/+videos/video-list/overview/video-overview.component.ts b/client/src/app/+videos/video-list/overview/video-overview.component.ts index 14532ca1e..b32e8f381 100644 --- a/client/src/app/+videos/video-list/overview/video-overview.component.ts +++ b/client/src/app/+videos/video-list/overview/video-overview.component.ts @@ -68,8 +68,8 @@ export class VideoOverviewComponent implements OnInit { this.isLoading = true this.overviewService.getVideosOverview(this.currentPage) - .subscribe( - overview => { + .subscribe({ + next: overview => { this.isLoading = false if (overview.tags.length === 0 && overview.channels.length === 0 && overview.categories.length === 0) { @@ -85,10 +85,10 @@ export class VideoOverviewComponent implements OnInit { this.overviews.push(overview) }, - err => { + error: err => { this.notifier.error(err.message) this.isLoading = false } - ) + }) } } diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts index 6aabb93a5..a1498e797 100644 --- a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts +++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts @@ -56,8 +56,8 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement this.authService.userInformationLoaded .pipe(switchMap(() => this.scopedTokensService.getScopedTokens())) - .subscribe( - tokens => { + .subscribe({ + next: tokens => { const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken) feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url @@ -74,10 +74,10 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement }) }, - err => { + error: err => { this.notifier.error(err.message) } - ) + }) } ngOnDestroy () { -- cgit v1.2.3