diff options
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 4783adf42..9498a06fe 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -50,7 +50,7 @@ export class VideoService { | |||
50 | .pipe(map(videoHash => ({ videoHash, translations }))) | 50 | .pipe(map(videoHash => ({ videoHash, translations }))) |
51 | }), | 51 | }), |
52 | map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), | 52 | map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), |
53 | catchError(res => this.restExtractor.handleError(res)) | 53 | catchError(err => this.restExtractor.handleError(err)) |
54 | ) | 54 | ) |
55 | } | 55 | } |
56 | 56 | ||
@@ -58,7 +58,7 @@ export class VideoService { | |||
58 | return this.authHttp.post(this.getVideoViewUrl(uuid), {}) | 58 | return this.authHttp.post(this.getVideoViewUrl(uuid), {}) |
59 | .pipe( | 59 | .pipe( |
60 | map(this.restExtractor.extractDataBool), | 60 | map(this.restExtractor.extractDataBool), |
61 | catchError(this.restExtractor.handleError) | 61 | catchError(err => this.restExtractor.handleError(err)) |
62 | ) | 62 | ) |
63 | } | 63 | } |
64 | 64 | ||
@@ -93,7 +93,7 @@ export class VideoService { | |||
93 | return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) | 93 | return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) |
94 | .pipe( | 94 | .pipe( |
95 | map(this.restExtractor.extractDataBool), | 95 | map(this.restExtractor.extractDataBool), |
96 | catchError(this.restExtractor.handleError) | 96 | catchError(err => this.restExtractor.handleError(err)) |
97 | ) | 97 | ) |
98 | } | 98 | } |
99 | 99 | ||
@@ -102,7 +102,7 @@ export class VideoService { | |||
102 | 102 | ||
103 | return this.authHttp | 103 | return this.authHttp |
104 | .request<{ video: { id: number, uuid: string } }>(req) | 104 | .request<{ video: { id: number, uuid: string } }>(req) |
105 | .pipe(catchError(this.restExtractor.handleError)) | 105 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
106 | } | 106 | } |
107 | 107 | ||
108 | getMyVideos (videoPagination: ComponentPagination, sort: VideoSortField): Observable<{ videos: Video[], totalVideos: number }> { | 108 | getMyVideos (videoPagination: ComponentPagination, sort: VideoSortField): Observable<{ videos: Video[], totalVideos: number }> { |
@@ -115,7 +115,7 @@ export class VideoService { | |||
115 | .get<ResultList<Video>>(UserService.BASE_USERS_URL + '/me/videos', { params }) | 115 | .get<ResultList<Video>>(UserService.BASE_USERS_URL + '/me/videos', { params }) |
116 | .pipe( | 116 | .pipe( |
117 | switchMap(res => this.extractVideos(res)), | 117 | switchMap(res => this.extractVideos(res)), |
118 | catchError(res => this.restExtractor.handleError(res)) | 118 | catchError(err => this.restExtractor.handleError(err)) |
119 | ) | 119 | ) |
120 | } | 120 | } |
121 | 121 | ||
@@ -133,7 +133,7 @@ export class VideoService { | |||
133 | .get<ResultList<Video>>(AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/videos', { params }) | 133 | .get<ResultList<Video>>(AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/videos', { params }) |
134 | .pipe( | 134 | .pipe( |
135 | switchMap(res => this.extractVideos(res)), | 135 | switchMap(res => this.extractVideos(res)), |
136 | catchError(res => this.restExtractor.handleError(res)) | 136 | catchError(err => this.restExtractor.handleError(err)) |
137 | ) | 137 | ) |
138 | } | 138 | } |
139 | 139 | ||
@@ -151,7 +151,7 @@ export class VideoService { | |||
151 | .get<ResultList<Video>>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params }) | 151 | .get<ResultList<Video>>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params }) |
152 | .pipe( | 152 | .pipe( |
153 | switchMap(res => this.extractVideos(res)), | 153 | switchMap(res => this.extractVideos(res)), |
154 | catchError(res => this.restExtractor.handleError(res)) | 154 | catchError(err => this.restExtractor.handleError(err)) |
155 | ) | 155 | ) |
156 | } | 156 | } |
157 | 157 | ||
@@ -178,7 +178,7 @@ export class VideoService { | |||
178 | .get<ResultList<Video>>(VideoService.BASE_VIDEO_URL, { params }) | 178 | .get<ResultList<Video>>(VideoService.BASE_VIDEO_URL, { params }) |
179 | .pipe( | 179 | .pipe( |
180 | switchMap(res => this.extractVideos(res)), | 180 | switchMap(res => this.extractVideos(res)), |
181 | catchError(res => this.restExtractor.handleError(res)) | 181 | catchError(err => this.restExtractor.handleError(err)) |
182 | ) | 182 | ) |
183 | } | 183 | } |
184 | 184 | ||
@@ -248,7 +248,7 @@ export class VideoService { | |||
248 | .get<ResultList<VideoServerModel>>(url, { params }) | 248 | .get<ResultList<VideoServerModel>>(url, { params }) |
249 | .pipe( | 249 | .pipe( |
250 | switchMap(res => this.extractVideos(res)), | 250 | switchMap(res => this.extractVideos(res)), |
251 | catchError(res => this.restExtractor.handleError(res)) | 251 | catchError(err => this.restExtractor.handleError(err)) |
252 | ) | 252 | ) |
253 | } | 253 | } |
254 | 254 | ||
@@ -257,7 +257,7 @@ export class VideoService { | |||
257 | .delete(VideoService.BASE_VIDEO_URL + id) | 257 | .delete(VideoService.BASE_VIDEO_URL + id) |
258 | .pipe( | 258 | .pipe( |
259 | map(this.restExtractor.extractDataBool), | 259 | map(this.restExtractor.extractDataBool), |
260 | catchError(res => this.restExtractor.handleError(res)) | 260 | catchError(err => this.restExtractor.handleError(err)) |
261 | ) | 261 | ) |
262 | } | 262 | } |
263 | 263 | ||
@@ -266,7 +266,7 @@ export class VideoService { | |||
266 | .get(environment.apiUrl + descriptionPath) | 266 | .get(environment.apiUrl + descriptionPath) |
267 | .pipe( | 267 | .pipe( |
268 | map(res => res[ 'description' ]), | 268 | map(res => res[ 'description' ]), |
269 | catchError(res => this.restExtractor.handleError(res)) | 269 | catchError(err => this.restExtractor.handleError(err)) |
270 | ) | 270 | ) |
271 | } | 271 | } |
272 | 272 | ||
@@ -286,7 +286,7 @@ export class VideoService { | |||
286 | const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating' | 286 | const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating' |
287 | 287 | ||
288 | return this.authHttp.get<UserVideoRate>(url) | 288 | return this.authHttp.get<UserVideoRate>(url) |
289 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 289 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
290 | } | 290 | } |
291 | 291 | ||
292 | private setVideoRate (id: number, rateType: VideoRateType) { | 292 | private setVideoRate (id: number, rateType: VideoRateType) { |
@@ -299,7 +299,7 @@ export class VideoService { | |||
299 | .put(url, body) | 299 | .put(url, body) |
300 | .pipe( | 300 | .pipe( |
301 | map(this.restExtractor.extractDataBool), | 301 | map(this.restExtractor.extractDataBool), |
302 | catchError(res => this.restExtractor.handleError(res)) | 302 | catchError(err => this.restExtractor.handleError(err)) |
303 | ) | 303 | ) |
304 | } | 304 | } |
305 | 305 | ||