diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 11:52:52 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 11:53:13 +0100 |
commit | fd45e8f43c2638478599ca75632518054461da85 (patch) | |
tree | 01e1fb5ddad53bde8fb2c48f348fb8add51cfdb3 /client/src/app/core/server | |
parent | b7a485121d71c95fcf5e432e4cc745cf91af4f93 (diff) | |
download | PeerTube-fd45e8f43c2638478599ca75632518054461da85.tar.gz PeerTube-fd45e8f43c2638478599ca75632518054461da85.tar.zst PeerTube-fd45e8f43c2638478599ca75632518054461da85.zip |
Add video privacy setting
Diffstat (limited to 'client/src/app/core/server')
-rw-r--r-- | client/src/app/core/server/server.service.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index ae507afce..cbc4074c9 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts | |||
@@ -19,6 +19,7 @@ export class ServerService { | |||
19 | private videoCategories: Array<{ id: number, label: string }> = [] | 19 | private videoCategories: Array<{ id: number, label: string }> = [] |
20 | private videoLicences: Array<{ id: number, label: string }> = [] | 20 | private videoLicences: Array<{ id: number, label: string }> = [] |
21 | private videoLanguages: Array<{ id: number, label: string }> = [] | 21 | private videoLanguages: Array<{ id: number, label: string }> = [] |
22 | private videoPrivacies: Array<{ id: number, label: string }> = [] | ||
22 | 23 | ||
23 | constructor (private http: HttpClient) {} | 24 | constructor (private http: HttpClient) {} |
24 | 25 | ||
@@ -39,6 +40,10 @@ export class ServerService { | |||
39 | return this.loadVideoAttributeEnum('languages', this.videoLanguages) | 40 | return this.loadVideoAttributeEnum('languages', this.videoLanguages) |
40 | } | 41 | } |
41 | 42 | ||
43 | loadVideoPrivacies () { | ||
44 | return this.loadVideoAttributeEnum('privacies', this.videoPrivacies) | ||
45 | } | ||
46 | |||
42 | getConfig () { | 47 | getConfig () { |
43 | return this.config | 48 | return this.config |
44 | } | 49 | } |
@@ -55,7 +60,14 @@ export class ServerService { | |||
55 | return this.videoLanguages | 60 | return this.videoLanguages |
56 | } | 61 | } |
57 | 62 | ||
58 | private loadVideoAttributeEnum (attributeName: 'categories' | 'licences' | 'languages', hashToPopulate: { id: number, label: string }[]) { | 63 | getVideoPrivacies () { |
64 | return this.videoPrivacies | ||
65 | } | ||
66 | |||
67 | private loadVideoAttributeEnum ( | ||
68 | attributeName: 'categories' | 'licences' | 'languages' | 'privacies', | ||
69 | hashToPopulate: { id: number, label: string }[] | ||
70 | ) { | ||
59 | return this.http.get(ServerService.BASE_VIDEO_URL + attributeName) | 71 | return this.http.get(ServerService.BASE_VIDEO_URL + attributeName) |
60 | .subscribe(data => { | 72 | .subscribe(data => { |
61 | Object.keys(data) | 73 | Object.keys(data) |