projects
/
oweals
/
peertube.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from upstream
[oweals/peertube.git]
/
client
/
src
/
app
/
shared
/
video
/
video-miniature.component.ts
diff --git
a/client/src/app/shared/video/video-miniature.component.ts
b/client/src/app/shared/video/video-miniature.component.ts
index 27098f4b4a0c097c5987572328d7b8dab1e5d7bb..2f951a1f1b3ecb25eeb7d1d84901b31922b9f4fc 100644
(file)
--- a/
client/src/app/shared/video/video-miniature.component.ts
+++ b/
client/src/app/shared/video/video-miniature.component.ts
@@
-2,6
+2,7
@@
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core
import { User } from '../users'
import { Video } from './video.model'
import { ServerService } from '@app/core'
import { User } from '../users'
import { Video } from './video.model'
import { ServerService } from '@app/core'
+import { VideoPrivacy } from '../../../../../shared'
export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto'
export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto'
@@
-16,12
+17,14
@@
export class VideoMiniatureComponent implements OnInit {
@Input() video: Video
@Input() ownerDisplayType: OwnerDisplayType = 'account'
@Input() video: Video
@Input() ownerDisplayType: OwnerDisplayType = 'account'
- isVideoBlur: boolean
-
private ownerDisplayTypeChosen: 'account' | 'videoChannel'
constructor (private serverService: ServerService) { }
private ownerDisplayTypeChosen: 'account' | 'videoChannel'
constructor (private serverService: ServerService) { }
+ get isVideoBlur () {
+ return this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())
+ }
+
ngOnInit () {
if (this.ownerDisplayType === 'account' || this.ownerDisplayType === 'videoChannel') {
this.ownerDisplayTypeChosen = this.ownerDisplayType
ngOnInit () {
if (this.ownerDisplayType === 'account' || this.ownerDisplayType === 'videoChannel') {
this.ownerDisplayTypeChosen = this.ownerDisplayType
@@
-38,8
+41,6
@@
export class VideoMiniatureComponent implements OnInit {
} else {
this.ownerDisplayTypeChosen = 'videoChannel'
}
} else {
this.ownerDisplayTypeChosen = 'videoChannel'
}
-
- this.isVideoBlur = this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())
}
displayOwnerAccount () {
}
displayOwnerAccount () {
@@
-49,4
+50,12
@@
export class VideoMiniatureComponent implements OnInit {
displayOwnerVideoChannel () {
return this.ownerDisplayTypeChosen === 'videoChannel'
}
displayOwnerVideoChannel () {
return this.ownerDisplayTypeChosen === 'videoChannel'
}
+
+ isUnlistedVideo () {
+ return this.video.privacy.id === VideoPrivacy.UNLISTED
+ }
+
+ isPrivateVideo () {
+ return this.video.privacy.id === VideoPrivacy.PRIVATE
+ }
}
}