diff options
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index f82aa7389..8870cbee4 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -23,6 +23,8 @@ import { Video } from './video.model' | |||
23 | import { objectToFormData } from '@app/shared/misc/utils' | 23 | import { objectToFormData } from '@app/shared/misc/utils' |
24 | import { Account } from '@app/shared/account/account.model' | 24 | import { Account } from '@app/shared/account/account.model' |
25 | import { AccountService } from '@app/shared/account/account.service' | 25 | import { AccountService } from '@app/shared/account/account.service' |
26 | import { VideoChannel } from '../../../../../shared/models/videos' | ||
27 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
26 | 28 | ||
27 | @Injectable() | 29 | @Injectable() |
28 | export class VideoService { | 30 | export class VideoService { |
@@ -115,6 +117,22 @@ export class VideoService { | |||
115 | .catch((res) => this.restExtractor.handleError(res)) | 117 | .catch((res) => this.restExtractor.handleError(res)) |
116 | } | 118 | } |
117 | 119 | ||
120 | getVideoChannelVideos ( | ||
121 | videoChannel: VideoChannel, | ||
122 | videoPagination: ComponentPagination, | ||
123 | sort: VideoSortField | ||
124 | ): Observable<{ videos: Video[], totalVideos: number}> { | ||
125 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | ||
126 | |||
127 | let params = new HttpParams() | ||
128 | params = this.restService.addRestGetParams(params, pagination, sort) | ||
129 | |||
130 | return this.authHttp | ||
131 | .get(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params }) | ||
132 | .map(this.extractVideos) | ||
133 | .catch((res) => this.restExtractor.handleError(res)) | ||
134 | } | ||
135 | |||
118 | getVideos ( | 136 | getVideos ( |
119 | videoPagination: ComponentPagination, | 137 | videoPagination: ComponentPagination, |
120 | sort: VideoSortField, | 138 | sort: VideoSortField, |
@@ -175,6 +193,13 @@ export class VideoService { | |||
175 | return this.buildBaseFeedUrls(params) | 193 | return this.buildBaseFeedUrls(params) |
176 | } | 194 | } |
177 | 195 | ||
196 | getVideoChannelFeedUrls (videoChannelId: number) { | ||
197 | let params = this.restService.addRestGetParams(new HttpParams()) | ||
198 | params = params.set('videoChannelId', videoChannelId.toString()) | ||
199 | |||
200 | return this.buildBaseFeedUrls(params) | ||
201 | } | ||
202 | |||
178 | searchVideos ( | 203 | searchVideos ( |
179 | search: string, | 204 | search: string, |
180 | videoPagination: ComponentPagination, | 205 | videoPagination: ComponentPagination, |