aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/video/video.model.ts')
-rw-r--r--client/src/app/shared/video/video.model.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts
index 48d562f9c..d37dc2c3e 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/video/video.model.ts
@@ -5,6 +5,7 @@ import { VideoConstant } from '../../../../../shared/models/videos/video.model'
5import { getAbsoluteAPIUrl } from '../misc/utils' 5import { getAbsoluteAPIUrl } from '../misc/utils'
6import { ServerConfig } from '../../../../../shared/models' 6import { ServerConfig } from '../../../../../shared/models'
7import { Actor } from '@app/shared/actor/actor.model' 7import { Actor } from '@app/shared/actor/actor.model'
8import { peertubeTranslate } from '@app/shared/i18n/i18n-utils'
8 9
9export class Video implements VideoServerModel { 10export class Video implements VideoServerModel {
10 by: string 11 by: string
@@ -68,7 +69,7 @@ export class Video implements VideoServerModel {
68 minutes.toString() + ':' + secondsPadding + seconds.toString() 69 minutes.toString() + ':' + secondsPadding + seconds.toString()
69 } 70 }
70 71
71 constructor (hash: VideoServerModel) { 72 constructor (hash: VideoServerModel, translations = {}) {
72 const absoluteAPIUrl = getAbsoluteAPIUrl() 73 const absoluteAPIUrl = getAbsoluteAPIUrl()
73 74
74 this.createdAt = new Date(hash.createdAt.toString()) 75 this.createdAt = new Date(hash.createdAt.toString())
@@ -98,6 +99,11 @@ export class Video implements VideoServerModel {
98 99
99 this.by = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host) 100 this.by = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host)
100 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) 101 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
102
103 this.category.label = peertubeTranslate(this.category.label, translations)
104 this.licence.label = peertubeTranslate(this.licence.label, translations)
105 this.language.label = peertubeTranslate(this.language.label, translations)
106 this.privacy.label = peertubeTranslate(this.privacy.label, translations)
101 } 107 }
102 108
103 isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { 109 isVideoNSFWForUser (user: User, serverConfig: ServerConfig) {