diff options
Diffstat (limited to 'client/src/app/shared/shared-main/video/video.service.ts')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.service.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index d67a2e192..c2e3d7511 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | FeedFormat, | 11 | FeedFormat, |
12 | NSFWPolicyType, | 12 | NSFWPolicyType, |
13 | ResultList, | 13 | ResultList, |
14 | Storyboard, | ||
14 | UserVideoRate, | 15 | UserVideoRate, |
15 | UserVideoRateType, | 16 | UserVideoRateType, |
16 | UserVideoRateUpdate, | 17 | UserVideoRateUpdate, |
@@ -344,6 +345,25 @@ export class VideoService { | |||
344 | ) | 345 | ) |
345 | } | 346 | } |
346 | 347 | ||
348 | // --------------------------------------------------------------------------- | ||
349 | |||
350 | getStoryboards (videoId: string | number) { | ||
351 | return this.authHttp | ||
352 | .get<{ storyboards: Storyboard[] }>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/storyboards') | ||
353 | .pipe( | ||
354 | map(({ storyboards }) => storyboards), | ||
355 | catchError(err => { | ||
356 | if (err.status === 404) { | ||
357 | return of([]) | ||
358 | } | ||
359 | |||
360 | this.restExtractor.handleError(err) | ||
361 | }) | ||
362 | ) | ||
363 | } | ||
364 | |||
365 | // --------------------------------------------------------------------------- | ||
366 | |||
347 | getSource (videoId: number) { | 367 | getSource (videoId: number) { |
348 | return this.authHttp | 368 | return this.authHttp |
349 | .get<{ source: VideoSource }>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/source') | 369 | .get<{ source: VideoSource }>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/source') |
@@ -358,6 +378,8 @@ export class VideoService { | |||
358 | ) | 378 | ) |
359 | } | 379 | } |
360 | 380 | ||
381 | // --------------------------------------------------------------------------- | ||
382 | |||
361 | setVideoLike (id: string, videoPassword: string) { | 383 | setVideoLike (id: string, videoPassword: string) { |
362 | return this.setVideoRate(id, 'like', videoPassword) | 384 | return this.setVideoRate(id, 'like', videoPassword) |
363 | } | 385 | } |
@@ -370,6 +392,8 @@ export class VideoService { | |||
370 | return this.setVideoRate(id, 'none', videoPassword) | 392 | return this.setVideoRate(id, 'none', videoPassword) |
371 | } | 393 | } |
372 | 394 | ||
395 | // --------------------------------------------------------------------------- | ||
396 | |||
373 | getUserVideoRating (id: string) { | 397 | getUserVideoRating (id: string) { |
374 | const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating' | 398 | const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating' |
375 | 399 | ||