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/+videos/+video-watch | |
parent | c186a67f90203af6bfa434f026efdc99193bcd65 (diff) | |
download | PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.gz PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.tar.zst PeerTube-1378c0d343028f3d40d7d795422684ab9e6a1599.zip |
Fix client lint
Diffstat (limited to 'client/src/app/+videos/+video-watch')
8 files changed, 66 insertions, 63 deletions
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 { | |||
90 | if (this.isUserLoggedIn === false) return | 90 | if (this.isUserLoggedIn === false) return |
91 | 91 | ||
92 | this.videoService.getUserVideoRating(this.video.id) | 92 | this.videoService.getUserVideoRating(this.video.id) |
93 | .subscribe( | 93 | .subscribe({ |
94 | ratingObject => { | 94 | next: ratingObject => { |
95 | if (!ratingObject) return | 95 | if (!ratingObject) return |
96 | 96 | ||
97 | this.userRating = ratingObject.rating | 97 | this.userRating = ratingObject.rating |
98 | this.userRatingLoaded.emit(this.userRating) | 98 | this.userRatingLoaded.emit(this.userRating) |
99 | }, | 99 | }, |
100 | 100 | ||
101 | err => this.notifier.error(err.message) | 101 | error: err => this.notifier.error(err.message) |
102 | ) | 102 | }) |
103 | } | 103 | } |
104 | 104 | ||
105 | private setRating (nextRating: UserVideoRateType) { | 105 | private setRating (nextRating: UserVideoRateType) { |
@@ -110,16 +110,16 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy { | |||
110 | } | 110 | } |
111 | 111 | ||
112 | ratingMethods[nextRating].call(this.videoService, this.video.id) | 112 | ratingMethods[nextRating].call(this.videoService, this.video.id) |
113 | .subscribe( | 113 | .subscribe({ |
114 | () => { | 114 | next: () => { |
115 | // Update the video like attribute | 115 | // Update the video like attribute |
116 | this.updateVideoRating(this.userRating, nextRating) | 116 | this.updateVideoRating(this.userRating, nextRating) |
117 | this.userRating = nextRating | 117 | this.userRating = nextRating |
118 | this.rateUpdated.emit(this.userRating) | 118 | this.rateUpdated.emit(this.userRating) |
119 | }, | 119 | }, |
120 | 120 | ||
121 | (err: { message: string }) => this.notifier.error(err.message) | 121 | error: err => this.notifier.error(err.message) |
122 | ) | 122 | }) |
123 | } | 123 | } |
124 | 124 | ||
125 | private updateVideoRating (oldRating: UserVideoRateType, newRating: UserVideoRateType) { | 125 | 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, | |||
137 | obs = this.addCommentThread(commentCreate) | 137 | obs = this.addCommentThread(commentCreate) |
138 | } | 138 | } |
139 | 139 | ||
140 | obs.subscribe( | 140 | obs.subscribe({ |
141 | comment => { | 141 | next: comment => { |
142 | this.addingComment = false | 142 | this.addingComment = false |
143 | this.commentCreated.emit(comment) | 143 | this.commentCreated.emit(comment) |
144 | this.form.reset() | 144 | this.form.reset() |
145 | }, | 145 | }, |
146 | 146 | ||
147 | err => { | 147 | error: err => { |
148 | this.addingComment = false | 148 | this.addingComment = false |
149 | 149 | ||
150 | this.notifier.error(err.text) | 150 | this.notifier.error(err.text) |
151 | } | 151 | } |
152 | ) | 152 | }) |
153 | } | 153 | } |
154 | 154 | ||
155 | isAddButtonDisplayed () { | 155 | 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 { | |||
149 | const user = this.authService.getUser() | 149 | const user = this.authService.getUser() |
150 | if (user.hasRight(UserRight.MANAGE_USERS)) { | 150 | if (user.hasRight(UserRight.MANAGE_USERS)) { |
151 | this.userService.getUserWithCache(account.userId) | 151 | this.userService.getUserWithCache(account.userId) |
152 | .subscribe( | 152 | .subscribe({ |
153 | user => this.commentUser = user, | 153 | next: user => this.commentUser = user, |
154 | 154 | ||
155 | err => this.notifier.error(err.message) | 155 | error: err => this.notifier.error(err.message) |
156 | ) | 156 | }) |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
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 { | |||
90 | 'filter:api.video-watch.video-thread-replies.list.result' | 90 | 'filter:api.video-watch.video-thread-replies.list.result' |
91 | ) | 91 | ) |
92 | 92 | ||
93 | obs.subscribe( | 93 | obs.subscribe({ |
94 | res => { | 94 | next: res => { |
95 | this.threadComments[commentId] = res | 95 | this.threadComments[commentId] = res |
96 | this.threadLoading[commentId] = false | 96 | this.threadLoading[commentId] = false |
97 | this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) | 97 | this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res }) |
98 | 98 | ||
99 | if (highlightThread) { | 99 | if (highlightThread) { |
100 | this.highlightedThread = new VideoComment(res.comment) | 100 | this.highlightedThread = new VideoComment(res.comment) |
101 | 101 | ||
102 | // Scroll to the highlighted thread | 102 | // Scroll to the highlighted thread |
103 | setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) | 103 | setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) |
104 | } | 104 | } |
105 | }, | 105 | }, |
106 | 106 | ||
107 | err => this.notifier.error(err.message) | 107 | error: err => this.notifier.error(err.message) |
108 | ) | 108 | }) |
109 | } | 109 | } |
110 | 110 | ||
111 | loadMoreThreads () { | 111 | loadMoreThreads () { |
@@ -123,8 +123,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
123 | 'filter:api.video-watch.video-threads.list.result' | 123 | 'filter:api.video-watch.video-threads.list.result' |
124 | ) | 124 | ) |
125 | 125 | ||
126 | obs.subscribe( | 126 | obs.subscribe({ |
127 | res => { | 127 | next: res => { |
128 | this.comments = this.comments.concat(res.data) | 128 | this.comments = this.comments.concat(res.data) |
129 | this.componentPagination.totalItems = res.total | 129 | this.componentPagination.totalItems = res.total |
130 | this.totalNotDeletedComments = res.totalNotDeletedComments | 130 | this.totalNotDeletedComments = res.totalNotDeletedComments |
@@ -133,8 +133,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
133 | this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) | 133 | this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) |
134 | }, | 134 | }, |
135 | 135 | ||
136 | err => this.notifier.error(err.message) | 136 | error: err => this.notifier.error(err.message) |
137 | ) | 137 | }) |
138 | } | 138 | } |
139 | 139 | ||
140 | onCommentThreadCreated (comment: VideoComment) { | 140 | onCommentThreadCreated (comment: VideoComment) { |
@@ -181,8 +181,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
181 | if (res === false) return false | 181 | if (res === false) return false |
182 | 182 | ||
183 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) | 183 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) |
184 | .subscribe( | 184 | .subscribe({ |
185 | () => { | 185 | next: () => { |
186 | if (this.highlightedThread?.id === commentToDelete.id) { | 186 | if (this.highlightedThread?.id === commentToDelete.id) { |
187 | commentToDelete = this.comments.find(c => c.id === commentToDelete.id) | 187 | commentToDelete = this.comments.find(c => c.id === commentToDelete.id) |
188 | 188 | ||
@@ -193,8 +193,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
193 | this.softDeleteComment(commentToDelete) | 193 | this.softDeleteComment(commentToDelete) |
194 | }, | 194 | }, |
195 | 195 | ||
196 | err => this.notifier.error(err.message) | 196 | error: err => this.notifier.error(err.message) |
197 | ) | 197 | }) |
198 | 198 | ||
199 | return true | 199 | return true |
200 | } | 200 | } |
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 { | |||
50 | this.descriptionLoading = true | 50 | this.descriptionLoading = true |
51 | 51 | ||
52 | this.videoService.loadCompleteDescription(this.video.descriptionPath) | 52 | this.videoService.loadCompleteDescription(this.video.descriptionPath) |
53 | .subscribe( | 53 | .subscribe({ |
54 | description => { | 54 | next: description => { |
55 | this.completeDescriptionShown = true | 55 | this.completeDescriptionShown = true |
56 | this.descriptionLoading = false | 56 | this.descriptionLoading = false |
57 | 57 | ||
@@ -61,11 +61,11 @@ export class VideoDescriptionComponent implements OnChanges { | |||
61 | this.updateVideoDescription(this.completeVideoDescription) | 61 | this.updateVideoDescription(this.completeVideoDescription) |
62 | }, | 62 | }, |
63 | 63 | ||
64 | error => { | 64 | error: err => { |
65 | this.descriptionLoading = false | 65 | this.descriptionLoading = false |
66 | this.notifier.error(error.message) | 66 | this.notifier.error(err.message) |
67 | } | 67 | } |
68 | ) | 68 | }) |
69 | } | 69 | } |
70 | 70 | ||
71 | onTimestampClicked (timestamp: number) { | 71 | 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 @@ | |||
1 | |||
2 | import { Component, EventEmitter, Input, Output } from '@angular/core' | 1 | import { Component, EventEmitter, Input, Output } from '@angular/core' |
3 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
4 | import { AuthService, ComponentPagination, LocalStorageService, Notifier, SessionStorageService, UserService } from '@app/core' | 3 | import { AuthService, ComponentPagination, LocalStorageService, Notifier, SessionStorageService, UserService } from '@app/core' |
@@ -196,12 +195,14 @@ export class VideoWatchPlaylistComponent { | |||
196 | autoPlayNextVideoPlaylist: this.autoPlayNextVideoPlaylist | 195 | autoPlayNextVideoPlaylist: this.autoPlayNextVideoPlaylist |
197 | } | 196 | } |
198 | 197 | ||
199 | this.userService.updateMyProfile(details).subscribe( | 198 | this.userService.updateMyProfile(details) |
200 | () => { | 199 | .subscribe({ |
201 | this.auth.refreshUserInformation() | 200 | next: () => { |
202 | }, | 201 | this.auth.refreshUserInformation() |
203 | err => this.notifier.error(err.message) | 202 | }, |
204 | ) | 203 | |
204 | error: err => this.notifier.error(err.message) | ||
205 | }) | ||
205 | } | 206 | } |
206 | } | 207 | } |
207 | 208 | ||
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 { | |||
84 | autoPlayNextVideo: this.autoPlayNextVideo | 84 | autoPlayNextVideo: this.autoPlayNextVideo |
85 | } | 85 | } |
86 | 86 | ||
87 | this.userService.updateMyProfile(details).subscribe( | 87 | this.userService.updateMyProfile(details) |
88 | () => { | 88 | .subscribe({ |
89 | this.authService.refreshUserInformation() | 89 | next: () => { |
90 | }, | 90 | this.authService.refreshUserInformation() |
91 | err => this.notifier.error(err.message) | 91 | }, |
92 | ) | 92 | |
93 | error: err => this.notifier.error(err.message) | ||
94 | }) | ||
93 | } | 95 | } |
94 | } | 96 | } |
95 | } | 97 | } |
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 { | |||
238 | ) | 238 | ) |
239 | 239 | ||
240 | forkJoin([ videoObs, this.videoCaptionService.listCaptions(videoId)]) | 240 | forkJoin([ videoObs, this.videoCaptionService.listCaptions(videoId)]) |
241 | .subscribe( | 241 | .subscribe({ |
242 | ([ video, captionsResult ]) => { | 242 | next: ([ video, captionsResult ]) => { |
243 | const queryParams = this.route.snapshot.queryParams | 243 | const queryParams = this.route.snapshot.queryParams |
244 | 244 | ||
245 | const urlOptions = { | 245 | const urlOptions = { |
@@ -260,23 +260,23 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
260 | .catch(err => this.handleGlobalError(err)) | 260 | .catch(err => this.handleGlobalError(err)) |
261 | }, | 261 | }, |
262 | 262 | ||
263 | err => this.handleRequestError(err) | 263 | error: err => this.handleRequestError(err) |
264 | ) | 264 | }) |
265 | } | 265 | } |
266 | 266 | ||
267 | private loadPlaylist (playlistId: string) { | 267 | private loadPlaylist (playlistId: string) { |
268 | if (this.isSameElement(this.playlist, playlistId)) return | 268 | if (this.isSameElement(this.playlist, playlistId)) return |
269 | 269 | ||
270 | this.playlistService.getVideoPlaylist(playlistId) | 270 | this.playlistService.getVideoPlaylist(playlistId) |
271 | .subscribe( | 271 | .subscribe({ |
272 | playlist => { | 272 | next: playlist => { |
273 | this.playlist = playlist | 273 | this.playlist = playlist |
274 | 274 | ||
275 | this.videoWatchPlaylist.loadPlaylistElements(playlist, !this.playlistPosition, this.playlistPosition) | 275 | this.videoWatchPlaylist.loadPlaylistElements(playlist, !this.playlistPosition, this.playlistPosition) |
276 | }, | 276 | }, |
277 | 277 | ||
278 | err => this.handleRequestError(err) | 278 | error: err => this.handleRequestError(err) |
279 | ) | 279 | }) |
280 | } | 280 | } |
281 | 281 | ||
282 | private isSameElement (element: VideoDetails | VideoPlaylist, newId: string) { | 282 | private isSameElement (element: VideoDetails | VideoPlaylist, newId: string) { |