import { AuthUser } from '@app/core'
import { User } from '@app/core/users/user.model'
import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'
+import { Account } from '@app/shared/shared-main/account/account.model'
+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,
VideoScheduleUpdate,
VideoState
} from '@shared/models'
-import { Account, Actor, VideoChannel } from '@app/shared/shared-main'
export class Video implements VideoServerModel {
byVideoChannel: string
displayName: string
url: string
host: string
- avatar?: Avatar
+ avatar?: ActorImage
}
channel: {
displayName: string
url: string
host: string
- avatar?: Avatar
+ avatar?: ActorImage
}
userHistory?: {
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`
+ }
}