diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index aef75d206..b0fff6526 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -322,8 +322,8 @@ export class VideoModel extends Model<VideoModel> { | |||
322 | @AllowNull(true) | 322 | @AllowNull(true) |
323 | @Default(null) | 323 | @Default(null) |
324 | @Is('VideoLanguage', value => throwIfNotValid(value, isVideoLanguageValid, 'language')) | 324 | @Is('VideoLanguage', value => throwIfNotValid(value, isVideoLanguageValid, 'language')) |
325 | @Column | 325 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max)) |
326 | language: number | 326 | language: string |
327 | 327 | ||
328 | @AllowNull(false) | 328 | @AllowNull(false) |
329 | @Is('VideoPrivacy', value => throwIfNotValid(value, isVideoPrivacyValid, 'privacy')) | 329 | @Is('VideoPrivacy', value => throwIfNotValid(value, isVideoPrivacyValid, 'privacy')) |
@@ -877,8 +877,10 @@ export class VideoModel extends Model<VideoModel> { | |||
877 | return licenceLabel | 877 | return licenceLabel |
878 | } | 878 | } |
879 | 879 | ||
880 | private static getLanguageLabel (id: number) { | 880 | private static getLanguageLabel (id: string) { |
881 | let languageLabel = VIDEO_LANGUAGES[id] | 881 | let languageLabel = VIDEO_LANGUAGES[id] |
882 | console.log(VIDEO_LANGUAGES) | ||
883 | console.log(id) | ||
882 | if (!languageLabel) languageLabel = 'Unknown' | 884 | if (!languageLabel) languageLabel = 'Unknown' |
883 | 885 | ||
884 | return languageLabel | 886 | return languageLabel |
@@ -1083,7 +1085,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1083 | let language | 1085 | let language |
1084 | if (this.language) { | 1086 | if (this.language) { |
1085 | language = { | 1087 | language = { |
1086 | identifier: this.language + '', | 1088 | identifier: this.language, |
1087 | name: VideoModel.getLanguageLabel(this.language) | 1089 | name: VideoModel.getLanguageLabel(this.language) |
1088 | } | 1090 | } |
1089 | } | 1091 | } |