1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add video privacy setting

This commit is contained in:
Chocobozzz 2017-10-31 11:52:52 +01:00
parent b7a485121d
commit fd45e8f43c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
48 changed files with 545 additions and 208 deletions

View file

@ -19,6 +19,7 @@ export class ServerService {
private videoCategories: Array<{ id: number, label: string }> = []
private videoLicences: Array<{ id: number, label: string }> = []
private videoLanguages: Array<{ id: number, label: string }> = []
private videoPrivacies: Array<{ id: number, label: string }> = []
constructor (private http: HttpClient) {}
@ -39,6 +40,10 @@ export class ServerService {
return this.loadVideoAttributeEnum('languages', this.videoLanguages)
}
loadVideoPrivacies () {
return this.loadVideoAttributeEnum('privacies', this.videoPrivacies)
}
getConfig () {
return this.config
}
@ -55,7 +60,14 @@ export class ServerService {
return this.videoLanguages
}
private loadVideoAttributeEnum (attributeName: 'categories' | 'licences' | 'languages', hashToPopulate: { id: number, label: string }[]) {
getVideoPrivacies () {
return this.videoPrivacies
}
private loadVideoAttributeEnum (
attributeName: 'categories' | 'licences' | 'languages' | 'privacies',
hashToPopulate: { id: number, label: string }[]
) {
return this.http.get(ServerService.BASE_VIDEO_URL + attributeName)
.subscribe(data => {
Object.keys(data)