diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-21 16:18:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | 22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd (patch) | |
tree | 93c53e0619f966bd9ff1bb698c411277a9447a41 /client/src/app/shared/video/video.service.ts | |
parent | 99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd (diff) | |
download | PeerTube-22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd.tar.gz PeerTube-22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd.tar.zst PeerTube-22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd.zip |
Add local user subscriptions
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index e44f1ee65..1a934c8e2 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -27,6 +27,7 @@ import { Account } from '@app/shared/account/account.model' | |||
27 | import { AccountService } from '@app/shared/account/account.service' | 27 | import { AccountService } from '@app/shared/account/account.service' |
28 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 28 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
29 | import { ServerService } from '@app/core' | 29 | import { ServerService } from '@app/core' |
30 | import { UserSubscriptionService } from '@app/shared/user-subscription' | ||
30 | 31 | ||
31 | @Injectable() | 32 | @Injectable() |
32 | export class VideoService { | 33 | export class VideoService { |
@@ -157,6 +158,23 @@ export class VideoService { | |||
157 | ) | 158 | ) |
158 | } | 159 | } |
159 | 160 | ||
161 | getUserSubscriptionVideos ( | ||
162 | videoPagination: ComponentPagination, | ||
163 | sort: VideoSortField | ||
164 | ): Observable<{ videos: Video[], totalVideos: number }> { | ||
165 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | ||
166 | |||
167 | let params = new HttpParams() | ||
168 | params = this.restService.addRestGetParams(params, pagination, sort) | ||
169 | |||
170 | return this.authHttp | ||
171 | .get<ResultList<Video>>(UserSubscriptionService.BASE_USER_SUBSCRIPTIONS_URL + '/videos', { params }) | ||
172 | .pipe( | ||
173 | switchMap(res => this.extractVideos(res)), | ||
174 | catchError(err => this.restExtractor.handleError(err)) | ||
175 | ) | ||
176 | } | ||
177 | |||
160 | getVideos ( | 178 | getVideos ( |
161 | videoPagination: ComponentPagination, | 179 | videoPagination: ComponentPagination, |
162 | sort: VideoSortField, | 180 | sort: VideoSortField, |