diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-03-27 21:11:37 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-03-27 21:11:37 +0200 |
commit | d07137b90b2b2b0c1e93a6f0e7bf8719b133027c (patch) | |
tree | 0bb642609819bc1c8ff2761c848f8db3a9934d88 /client/src/app/videos/shared/video.service.ts | |
parent | 6f0c39e2de400685b7baf8340b9e132f2659365a (diff) | |
download | PeerTube-d07137b90b2b2b0c1e93a6f0e7bf8719b133027c.tar.gz PeerTube-d07137b90b2b2b0c1e93a6f0e7bf8719b133027c.tar.zst PeerTube-d07137b90b2b2b0c1e93a6f0e7bf8719b133027c.zip |
Client: add support for video licences
Diffstat (limited to 'client/src/app/videos/shared/video.service.ts')
-rw-r--r-- | client/src/app/videos/shared/video.service.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index debc114aa..15f017e33 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts | |||
@@ -23,6 +23,7 @@ export class VideoService { | |||
23 | private static BASE_VIDEO_URL = '/api/v1/videos/'; | 23 | private static BASE_VIDEO_URL = '/api/v1/videos/'; |
24 | 24 | ||
25 | videoCategories: Array<{ id: number, label: string }> = []; | 25 | videoCategories: Array<{ id: number, label: string }> = []; |
26 | videoLicences: Array<{ id: number, label: string }> = []; | ||
26 | 27 | ||
27 | constructor( | 28 | constructor( |
28 | private authService: AuthService, | 29 | private authService: AuthService, |
@@ -45,6 +46,19 @@ export class VideoService { | |||
45 | }); | 46 | }); |
46 | } | 47 | } |
47 | 48 | ||
49 | loadVideoLicences() { | ||
50 | return this.http.get(VideoService.BASE_VIDEO_URL + 'licences') | ||
51 | .map(this.restExtractor.extractDataGet) | ||
52 | .subscribe(data => { | ||
53 | Object.keys(data).forEach(licenceKey => { | ||
54 | this.videoLicences.push({ | ||
55 | id: parseInt(licenceKey), | ||
56 | label: data[licenceKey] | ||
57 | }); | ||
58 | }); | ||
59 | }); | ||
60 | } | ||
61 | |||
48 | getVideo(id: string): Observable<Video> { | 62 | getVideo(id: string): Observable<Video> { |
49 | return this.http.get(VideoService.BASE_VIDEO_URL + id) | 63 | return this.http.get(VideoService.BASE_VIDEO_URL + id) |
50 | .map(this.restExtractor.extractDataGet) | 64 | .map(this.restExtractor.extractDataGet) |