aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-24 15:10:54 +0200
committerChocobozzz <me@florianbigard.com>2018-04-24 15:13:19 +0200
commit0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb (patch)
tree79b5befbc6a04c007e5919805f1514d065b30e11 /client/src/app/shared/video/video.service.ts
parentb4d1af3dd8cdab2d58927e671d62194ca383cd75 (diff)
downloadPeerTube-0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb.tar.gz
PeerTube-0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb.tar.zst
PeerTube-0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb.zip
Add account view
Diffstat (limited to 'client/src/app/shared/video/video.service.ts')
-rw-r--r--client/src/app/shared/video/video.service.ts18
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 ef8babd55..f82aa7389 100644
--- a/client/src/app/shared/video/video.service.ts
+++ b/client/src/app/shared/video/video.service.ts
@@ -21,6 +21,8 @@ import { VideoDetails } from './video-details.model'
21import { VideoEdit } from './video-edit.model' 21import { VideoEdit } from './video-edit.model'
22import { Video } from './video.model' 22import { 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'
25import { AccountService } from '@app/shared/account/account.service'
24 26
25@Injectable() 27@Injectable()
26export class VideoService { 28export class VideoService {
@@ -97,6 +99,22 @@ export class VideoService {
97 .catch((res) => this.restExtractor.handleError(res)) 99 .catch((res) => this.restExtractor.handleError(res))
98 } 100 }
99 101
102 getAccountVideos (
103 account: Account,
104 videoPagination: ComponentPagination,
105 sort: VideoSortField
106 ): Observable<{ videos: Video[], totalVideos: number}> {
107 const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
108
109 let params = new HttpParams()
110 params = this.restService.addRestGetParams(params, pagination, sort)
111
112 return this.authHttp
113 .get(AccountService.BASE_ACCOUNT_URL + account.id + '/videos', { params })
114 .map(this.extractVideos)
115 .catch((res) => this.restExtractor.handleError(res))
116 }
117
100 getVideos ( 118 getVideos (
101 videoPagination: ComponentPagination, 119 videoPagination: ComponentPagination,
102 sort: VideoSortField, 120 sort: VideoSortField,