mirror of https://github.com/Chocobozzz/PeerTube
Fix lint & tests
parent
09033f7aa3
commit
2a5518a667
|
@ -147,7 +147,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
|
||||
this.queryParamsSub = this.route.queryParams.subscribe(async queryParams => {
|
||||
const videoId = queryParams[ 'videoId' ]
|
||||
if (videoId) await this.loadVideo(videoId)
|
||||
if (videoId) this.loadVideo(videoId)
|
||||
|
||||
const start = queryParams[ 'start' ]
|
||||
if (this.player && start) this.player.currentTime(parseInt(start, 10))
|
||||
|
|
|
@ -583,16 +583,18 @@ export class UserModel extends Model<UserModel> {
|
|||
}
|
||||
|
||||
canGetVideo (video: MVideoFullLight) {
|
||||
if (video.privacy === VideoPrivacy.INTERNAL) return true
|
||||
|
||||
if (video.privacy === VideoPrivacy.PRIVATE) {
|
||||
return video.VideoChannel && video.VideoChannel.Account.userId === this.id
|
||||
}
|
||||
const videoUserId = video.VideoChannel.Account.userId
|
||||
|
||||
if (video.isBlacklisted()) {
|
||||
return this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
|
||||
return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
|
||||
}
|
||||
|
||||
if (video.privacy === VideoPrivacy.PRIVATE) {
|
||||
return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
|
||||
}
|
||||
|
||||
if (video.privacy === VideoPrivacy.INTERNAL) return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue