diff options
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/video-details.model.ts | 6 | ||||
-rw-r--r-- | client/src/app/shared/video/video.model.ts | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index bdcc0bbba..d346f985c 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts | |||
@@ -44,7 +44,11 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | isBlackistableBy (user: AuthUser) { | 46 | isBlackistableBy (user: AuthUser) { |
47 | return user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true | 47 | return this.blacklisted !== true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true |
48 | } | ||
49 | |||
50 | isUnblacklistableBy (user: AuthUser) { | ||
51 | return this.blacklisted === true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true | ||
48 | } | 52 | } |
49 | 53 | ||
50 | isUpdatableBy (user: AuthUser) { | 54 | isUpdatableBy (user: AuthUser) { |
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index 6b1a299ea..ec0afcccb 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -41,6 +41,8 @@ export class Video implements VideoServerModel { | |||
41 | waitTranscoding?: boolean | 41 | waitTranscoding?: boolean |
42 | state?: VideoConstant<VideoState> | 42 | state?: VideoConstant<VideoState> |
43 | scheduledUpdate?: VideoScheduleUpdate | 43 | scheduledUpdate?: VideoScheduleUpdate |
44 | blacklisted?: boolean | ||
45 | blacklistedReason?: string | ||
44 | 46 | ||
45 | account: { | 47 | account: { |
46 | id: number | 48 | id: number |
@@ -62,6 +64,10 @@ export class Video implements VideoServerModel { | |||
62 | avatar: Avatar | 64 | avatar: Avatar |
63 | } | 65 | } |
64 | 66 | ||
67 | static buildClientUrl (videoUUID: string) { | ||
68 | return '/videos/watch/' + videoUUID | ||
69 | } | ||
70 | |||
65 | private static createDurationString (duration: number) { | 71 | private static createDurationString (duration: number) { |
66 | const hours = Math.floor(duration / 3600) | 72 | const hours = Math.floor(duration / 3600) |
67 | const minutes = Math.floor((duration % 3600) / 60) | 73 | const minutes = Math.floor((duration % 3600) / 60) |
@@ -116,6 +122,9 @@ export class Video implements VideoServerModel { | |||
116 | 122 | ||
117 | this.scheduledUpdate = hash.scheduledUpdate | 123 | this.scheduledUpdate = hash.scheduledUpdate |
118 | if (this.state) this.state.label = peertubeTranslate(this.state.label, translations) | 124 | if (this.state) this.state.label = peertubeTranslate(this.state.label, translations) |
125 | |||
126 | this.blacklisted = hash.blacklisted | ||
127 | this.blacklistedReason = hash.blacklistedReason | ||
119 | } | 128 | } |
120 | 129 | ||
121 | isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { | 130 | isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { |