aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-25 16:56:13 +0200
committerChocobozzz <me@florianbigard.com>2018-04-25 16:56:13 +0200
commit170726f523ff48f89da45473fc53ca54784f43dd (patch)
treef9f783ebdfc934c6831396c2bf33f658d6640583 /client/src/app/shared/video/video.service.ts
parentcc918ac3f45e32f031cce7b6e0473e5c2c34b8ae (diff)
downloadPeerTube-170726f523ff48f89da45473fc53ca54784f43dd.tar.gz
PeerTube-170726f523ff48f89da45473fc53ca54784f43dd.tar.zst
PeerTube-170726f523ff48f89da45473fc53ca54784f43dd.zip
Implement video channel views
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r--client/src/app/shared/video/video.service.ts25
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'
23import { objectToFormData } from '@app/shared/misc/utils' 23import { objectToFormData } from '@app/shared/misc/utils'
24import { Account } from '@app/shared/account/account.model' 24import { Account } from '@app/shared/account/account.model'
25import { AccountService } from '@app/shared/account/account.service' 25import { AccountService } from '@app/shared/account/account.service'
26import { VideoChannel } from '../../../../../shared/models/videos'
27import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
26 28
27@Injectable() 29@Injectable()
28export class VideoService { 30export 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,