aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-videos/account-videos.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+accounts/account-videos/account-videos.component.ts')
-rw-r--r--client/src/app/+accounts/account-videos/account-videos.component.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts
index 3134a8ee2..58d0719fd 100644
--- a/client/src/app/+accounts/account-videos/account-videos.component.ts
+++ b/client/src/app/+accounts/account-videos/account-videos.component.ts
@@ -6,6 +6,7 @@ import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenServi
6import { immutableAssign } from '@app/helpers' 6import { immutableAssign } from '@app/helpers'
7import { Account, AccountService, VideoService } from '@app/shared/shared-main' 7import { Account, AccountService, VideoService } from '@app/shared/shared-main'
8import { AbstractVideoList } from '@app/shared/shared-video-miniature' 8import { AbstractVideoList } from '@app/shared/shared-video-miniature'
9import { VideoFilter } from '@shared/models'
9 10
10@Component({ 11@Component({
11 selector: 'my-account-videos', 12 selector: 'my-account-videos',
@@ -18,6 +19,8 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
18 titlePage: string 19 titlePage: string
19 loadOnInit = false 20 loadOnInit = false
20 21
22 filter: VideoFilter = null
23
21 private account: Account 24 private account: Account
22 private accountSub: Subscription 25 private accountSub: Subscription
23 26
@@ -40,6 +43,8 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
40 ngOnInit () { 43 ngOnInit () {
41 super.ngOnInit() 44 super.ngOnInit()
42 45
46 this.enableAllFilterIfPossible()
47
43 // Parent get the account for us 48 // Parent get the account for us
44 this.accountSub = this.accountService.accountLoaded 49 this.accountSub = this.accountService.accountLoaded
45 .pipe(first()) 50 .pipe(first())
@@ -59,9 +64,16 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
59 64
60 getVideosObservable (page: number) { 65 getVideosObservable (page: number) {
61 const newPagination = immutableAssign(this.pagination, { currentPage: page }) 66 const newPagination = immutableAssign(this.pagination, { currentPage: page })
67 const options = {
68 account: this.account,
69 videoPagination: newPagination,
70 sort: this.sort,
71 nsfwPolicy: this.nsfwPolicy,
72 videoFilter: this.filter
73 }
62 74
63 return this.videoService 75 return this.videoService
64 .getAccountVideos(this.account, newPagination, this.sort) 76 .getAccountVideos(options)
65 .pipe( 77 .pipe(
66 tap(({ total }) => { 78 tap(({ total }) => {
67 this.titlePage = $localize`Published ${total} videos` 79 this.titlePage = $localize`Published ${total} videos`
@@ -69,6 +81,12 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
69 ) 81 )
70 } 82 }
71 83
84 toggleModerationDisplay () {
85 this.filter = this.buildLocalFilter(this.filter, null)
86
87 this.reloadVideos()
88 }
89
72 generateSyndicationList () { 90 generateSyndicationList () {
73 this.syndicationItems = this.videoService.getAccountFeedUrls(this.account.id) 91 this.syndicationItems = this.videoService.getAccountFeedUrls(this.account.id)
74 } 92 }