X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fvideo%2Fvideo.model.ts;h=b11316471fe0772d3e05edcbfebfdea712c294ca;hb=3c10840fa90fc88fc98e8169faf4745ff6c80893;hp=f0a4a3f37c031a9a7b33797d31ed2209e1750ec5;hpb=d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb;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 f0a4a3f37..b11316471 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -2,6 +2,7 @@ import { AuthUser } from '@app/core' import { User } from '@app/core/users/user.model' import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers' import { Actor } from '@app/shared/shared-main/account/actor.model' +import { buildVideoWatchPath } from '@shared/core-utils' import { peertubeTranslate } from '@shared/core-utils/i18n' import { ActorImage, @@ -9,9 +10,11 @@ import { UserRight, Video as VideoServerModel, VideoConstant, + VideoFile, VideoPrivacy, VideoScheduleUpdate, - VideoState + VideoState, + VideoStreamingPlaylist } from '@shared/models' export class Video implements VideoServerModel { @@ -51,7 +54,7 @@ export class Video implements VideoServerModel { embedPath: string embedUrl: string - url?: string + url: string views: number likes: number @@ -64,8 +67,12 @@ export class Video implements VideoServerModel { waitTranscoding?: boolean state?: VideoConstant scheduledUpdate?: VideoScheduleUpdate + blacklisted?: boolean - blockedReason?: string + blacklistedReason?: string + + blockedOwner?: boolean + blockedServer?: boolean account: { id: number @@ -91,15 +98,18 @@ export class Video implements VideoServerModel { pluginData?: any + streamingPlaylists?: VideoStreamingPlaylist[] + files?: VideoFile[] + static buildWatchUrl (video: Partial>) { - return '/w/' + (video.shortUUID || video.uuid) + return buildVideoWatchPath({ shortUUID: video.shortUUID || video.uuid }) } static buildUpdateUrl (video: Pick) { return '/videos/update/' + video.uuid } - constructor (hash: VideoServerModel, translations = {}) { + constructor (hash: VideoServerModel, translations: { [ id: string ]: string } = {}) { const absoluteAPIUrl = getAbsoluteAPIUrl() this.createdAt = new Date(hash.createdAt.toString()) @@ -162,7 +172,13 @@ export class Video implements VideoServerModel { if (this.state) this.state.label = peertubeTranslate(this.state.label, translations) this.blacklisted = hash.blacklisted - this.blockedReason = hash.blacklistedReason + this.blacklistedReason = hash.blacklistedReason + + this.blockedOwner = hash.blockedOwner + this.blockedServer = hash.blockedServer + + this.streamingPlaylists = hash.streamingPlaylists + this.files = hash.files this.userHistory = hash.userHistory