diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
commit | 0aa52e170727ac6bdf441bcaa2353ae0b8a354ed (patch) | |
tree | 52fa047cf9970590cab1dcc7a3e5caa8eb004171 /client/src/app/+accounts/account-videos | |
parent | ff2cac9fa361a3c5489078f441ed54230c045971 (diff) | |
download | PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.gz PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.zst PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.zip |
Add ability to display all channel/account videos
Diffstat (limited to 'client/src/app/+accounts/account-videos')
-rw-r--r-- | client/src/app/+accounts/account-videos/account-videos.component.ts | 20 |
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 | |||
6 | import { immutableAssign } from '@app/helpers' | 6 | import { immutableAssign } from '@app/helpers' |
7 | import { Account, AccountService, VideoService } from '@app/shared/shared-main' | 7 | import { Account, AccountService, VideoService } from '@app/shared/shared-main' |
8 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | 8 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' |
9 | import { 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 | } |