X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo%2Fvideo-details.model.ts;h=fa4ca7f9391014a7729dbcbfe6c05a2fc902ab58;hb=b0c36821d1dcf362f14c99ca3741e7d03aea0a04;hp=e500ad6fc37208ef22c81aa92d8f1768b4cfbace;hpb=2186386cca113506791583cb07d6ccacba7af4e0;p=oweals%2Fpeertube.git diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index e500ad6fc..fa4ca7f93 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts @@ -1,14 +1,8 @@ -import { - UserRight, - VideoChannel, - VideoConstant, - VideoDetails as VideoDetailsServerModel, - VideoFile, - VideoState -} from '../../../../../shared' +import { UserRight, VideoConstant, VideoDetails as VideoDetailsServerModel, VideoFile, VideoState } from '../../../../../shared' import { AuthUser } from '../../core' import { Video } from '../../shared/video/video.model' import { Account } from '@app/shared/account/account.model' +import { VideoChannel } from '@app/shared/video-channel/video-channel.model' export class VideoDetails extends Video implements VideoDetailsServerModel { descriptionPath: string @@ -30,7 +24,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { this.descriptionPath = hash.descriptionPath this.files = hash.files - this.channel = hash.channel + this.channel = new VideoChannel(hash.channel) this.account = new Account(hash.account) this.tags = hash.tags this.support = hash.support @@ -44,7 +38,11 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { } isBlackistableBy (user: AuthUser) { - return user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true && this.isLocal === false + return this.blacklisted !== true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true + } + + isUnblacklistableBy (user: AuthUser) { + return this.blacklisted === true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true } isUpdatableBy (user: AuthUser) {