X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fvideo%2Fvideo.model.ts;h=526d10e32faae2c3c62430f0ca2e37666d18d1ab;hb=c7027c06e9a73dad99d3f9bd9937a41a763850ce;hp=04e7bd7176f3a5ae4303c14d1dae21810c33c706;hpb=69524f6ed170c74fab8d5833920c389fde992f3e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index 04e7bd717..526d10e32 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -6,7 +6,7 @@ import { Actor } from '@app/shared/shared-main/account/actor.model' import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model' import { peertubeTranslate } from '@shared/core-utils/i18n' import { - Avatar, + ActorImage, ServerConfig, UserRight, Video as VideoServerModel, @@ -20,9 +20,6 @@ export class Video implements VideoServerModel { byVideoChannel: string byAccount: string - accountAvatarUrl: string - videoChannelAvatarUrl: string - createdAt: Date updatedAt: Date publishedAt: Date @@ -72,7 +69,7 @@ export class Video implements VideoServerModel { displayName: string url: string host: string - avatar?: Avatar + avatar?: ActorImage } channel: { @@ -81,7 +78,7 @@ export class Video implements VideoServerModel { displayName: string url: string host: string - avatar?: Avatar + avatar?: ActorImage } userHistory?: { @@ -144,8 +141,6 @@ export class Video implements VideoServerModel { this.byAccount = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host) this.byVideoChannel = Actor.CREATE_BY_STRING(hash.channel.name, hash.channel.host) - this.accountAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.account) - this.videoChannelAvatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this.channel) this.category.label = peertubeTranslate(this.category.label, translations) this.licence.label = peertubeTranslate(this.licence.label, translations) @@ -203,4 +198,14 @@ export class Video implements VideoServerModel { canBeDuplicatedBy (user: AuthUser) { return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES) } + + getExactNumberOfViews () { + if (this.views < 1000) return '' + + if (this.isLive) { + return $localize`${this.views} viewers` + } + + return $localize`${this.views} views` + } }