aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/video/video.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main/video/video.service.ts')
-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