aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-20 09:05:43 +0200
committerChocobozzz <me@florianbigard.com>2021-10-20 09:25:44 +0200
commit978c87e7f58b6673fe60f04f1767bc9e02ea4936 (patch)
treee7d48735d4099fec8c7732f33e7dadb09c0eac80 /client/src/app/shared/shared-main
parent7e76cc380040e40a2292a9dc825f037c9b538030 (diff)
downloadPeerTube-978c87e7f58b6673fe60f04f1767bc9e02ea4936.tar.gz
PeerTube-978c87e7f58b6673fe60f04f1767bc9e02ea4936.tar.zst
PeerTube-978c87e7f58b6673fe60f04f1767bc9e02ea4936.zip
Add channel filters for my videos/followers
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index 2f43f1b9d..7935569e7 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -13,6 +13,7 @@ import {
13 UserVideoRateType, 13 UserVideoRateType,
14 UserVideoRateUpdate, 14 UserVideoRateUpdate,
15 Video as VideoServerModel, 15 Video as VideoServerModel,
16 VideoChannel as VideoChannelServerModel,
16 VideoConstant, 17 VideoConstant,
17 VideoDetails as VideoDetailsServerModel, 18 VideoDetails as VideoDetailsServerModel,
18 VideoFileMetadata, 19 VideoFileMetadata,
@@ -122,7 +123,14 @@ export class VideoService {
122 .pipe(catchError(err => this.restExtractor.handleError(err))) 123 .pipe(catchError(err => this.restExtractor.handleError(err)))
123 } 124 }
124 125
125 getMyVideos (videoPagination: ComponentPaginationLight, sort: VideoSortField, search?: string): Observable<ResultList<Video>> { 126 getMyVideos (options: {
127 videoPagination: ComponentPaginationLight
128 sort: VideoSortField
129 userChannels?: VideoChannelServerModel[]
130 search?: string
131 }): Observable<ResultList<Video>> {
132 const { videoPagination, sort, userChannels = [], search } = options
133
126 const pagination = this.restService.componentToRestPagination(videoPagination) 134 const pagination = this.restService.componentToRestPagination(videoPagination)
127 135
128 let params = new HttpParams() 136 let params = new HttpParams()
@@ -133,6 +141,16 @@ export class VideoService {
133 isLive: { 141 isLive: {
134 prefix: 'isLive:', 142 prefix: 'isLive:',
135 isBoolean: true 143 isBoolean: true
144 },
145 channelId: {
146 prefix: 'channel:',
147 handler: (name: string) => {
148 const channel = userChannels.find(c => c.name === name)
149
150 if (channel) return channel.id
151
152 return undefined
153 }
136 } 154 }
137 }) 155 })
138 156