diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-25 15:11:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-25 15:11:25 +0200 |
commit | ad77475251c3516dd5851a08655be79d7bf76245 (patch) | |
tree | 3b816fa225a8b9f50bbdc6edd8bdc2d2dfbe5ce2 /client/src/app/shared/video-caption | |
parent | f842e810b450a34275d8d453d5d9431a4e1b882a (diff) | |
download | PeerTube-ad77475251c3516dd5851a08655be79d7bf76245.tar.gz PeerTube-ad77475251c3516dd5851a08655be79d7bf76245.tar.zst PeerTube-ad77475251c3516dd5851a08655be79d7bf76245.zip |
Sort video captions
Diffstat (limited to 'client/src/app/shared/video-caption')
-rw-r--r-- | client/src/app/shared/video-caption/video-caption.service.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/shared/video-caption/video-caption.service.ts b/client/src/app/shared/video-caption/video-caption.service.ts index e835981dd..0ff094d1f 100644 --- a/client/src/app/shared/video-caption/video-caption.service.ts +++ b/client/src/app/shared/video-caption/video-caption.service.ts | |||
@@ -6,7 +6,7 @@ import { ResultList } from '../../../../../shared' | |||
6 | import { RestExtractor, RestService } from '../rest' | 6 | import { RestExtractor, RestService } from '../rest' |
7 | import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' | 7 | import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' |
8 | import { VideoService } from '@app/shared/video/video.service' | 8 | import { VideoService } from '@app/shared/video/video.service' |
9 | import { objectToFormData } from '@app/shared/misc/utils' | 9 | import { objectToFormData, sortBy } from '@app/shared/misc/utils' |
10 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | 10 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' |
11 | 11 | ||
12 | @Injectable() | 12 | @Injectable() |
@@ -19,6 +19,11 @@ export class VideoCaptionService { | |||
19 | 19 | ||
20 | listCaptions (videoId: number | string): Observable<ResultList<VideoCaption>> { | 20 | listCaptions (videoId: number | string): Observable<ResultList<VideoCaption>> { |
21 | return this.authHttp.get<ResultList<VideoCaption>>(VideoService.BASE_VIDEO_URL + videoId + '/captions') | 21 | return this.authHttp.get<ResultList<VideoCaption>>(VideoService.BASE_VIDEO_URL + videoId + '/captions') |
22 | .pipe(map(res => { | ||
23 | sortBy(res.data, 'language', 'label') | ||
24 | |||
25 | return res | ||
26 | })) | ||
22 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 27 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
23 | } | 28 | } |
24 | 29 | ||