From 9d3ef9fe052ed29bd67566754cb28662bd122234 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 Apr 2018 14:39:52 +0200 Subject: Use ISO 639 for languages --- client/src/app/core/server/server.service.ts | 13 +++++++------ client/src/app/shared/video/video-edit.model.ts | 2 +- client/src/app/shared/video/video.model.ts | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index a8beb242d..a71c6d0bf 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -6,6 +6,7 @@ import { ReplaySubject } from 'rxjs/ReplaySubject' import { ServerConfig } from '../../../../../shared' import { About } from '../../../../../shared/models/server/about.model' import { environment } from '../../../environments/environment' +import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos' @Injectable() export class ServerService { @@ -57,10 +58,10 @@ export class ServerService { videoQuota: -1 } } - 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 }> = [] + private videoCategories: Array> = [] + private videoLicences: Array> = [] + private videoLanguages: Array> = [] + private videoPrivacies: Array> = [] constructor (private http: HttpClient) { this.loadConfigLocally() @@ -118,7 +119,7 @@ export class ServerService { private loadVideoAttributeEnum ( attributeName: 'categories' | 'licences' | 'languages' | 'privacies', - hashToPopulate: { id: number, label: string }[], + hashToPopulate: VideoConstant[], notifier: ReplaySubject, sort = false ) { @@ -127,7 +128,7 @@ export class ServerService { Object.keys(data) .forEach(dataKey => { hashToPopulate.push({ - id: parseInt(dataKey, 10), + id: dataKey, label: data[dataKey] }) }) diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts index c1a70d1b3..39826d71e 100644 --- a/client/src/app/shared/video/video-edit.model.ts +++ b/client/src/app/shared/video/video-edit.model.ts @@ -4,7 +4,7 @@ import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy. export class VideoEdit { category: number licence: number - language: number + language: string description: string name: string tags: string[] diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index e25c172e0..a284c1688 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts @@ -13,7 +13,7 @@ export class Video implements VideoServerModel { publishedAt: Date category: VideoConstant licence: VideoConstant - language: VideoConstant + language: VideoConstant privacy: VideoConstant description: string duration: number -- cgit v1.2.3