diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-13 10:24:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-13 10:24:28 +0100 |
commit | 066e94c5382a761180c7d82fa24b31b66dbeaca4 (patch) | |
tree | 36037c2c5aaa6c86c2299ceafe6ec35dd1abbd13 /client/src/app/shared/video | |
parent | 66c3b7744c6c7a91b9538eb5a6e0ae07e0a5a6af (diff) | |
download | PeerTube-066e94c5382a761180c7d82fa24b31b66dbeaca4.tar.gz PeerTube-066e94c5382a761180c7d82fa24b31b66dbeaca4.tar.zst PeerTube-066e94c5382a761180c7d82fa24b31b66dbeaca4.zip |
Add "local" videos in menu
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index a151a2983..0a8894fd9 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -7,6 +7,7 @@ import { Video as VideoServerModel, VideoDetails as VideoDetailsServerModel } fr | |||
7 | import { ResultList } from '../../../../../shared/models/result-list.model' | 7 | import { ResultList } from '../../../../../shared/models/result-list.model' |
8 | import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-video-rate-update.model' | 8 | import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-video-rate-update.model' |
9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' | 9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' |
10 | import { VideoFilter } from '../../../../../shared/models/videos/video-query.type' | ||
10 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' | 11 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' |
11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' | 12 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' |
12 | import { environment } from '../../../environments/environment' | 13 | import { environment } from '../../../environments/environment' |
@@ -94,12 +95,20 @@ export class VideoService { | |||
94 | .catch((res) => this.restExtractor.handleError(res)) | 95 | .catch((res) => this.restExtractor.handleError(res)) |
95 | } | 96 | } |
96 | 97 | ||
97 | getVideos (videoPagination: ComponentPagination, sort: SortField): Observable<{ videos: Video[], totalVideos: number}> { | 98 | getVideos ( |
99 | videoPagination: ComponentPagination, | ||
100 | sort: SortField, | ||
101 | filter?: VideoFilter | ||
102 | ): Observable<{ videos: Video[], totalVideos: number}> { | ||
98 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | 103 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) |
99 | 104 | ||
100 | let params = new HttpParams() | 105 | let params = new HttpParams() |
101 | params = this.restService.addRestGetParams(params, pagination, sort) | 106 | params = this.restService.addRestGetParams(params, pagination, sort) |
102 | 107 | ||
108 | if (filter) { | ||
109 | params = params.set('filter', filter) | ||
110 | } | ||
111 | |||
103 | return this.authHttp | 112 | return this.authHttp |
104 | .get(VideoService.BASE_VIDEO_URL, { params }) | 113 | .get(VideoService.BASE_VIDEO_URL, { params }) |
105 | .map(this.extractVideos) | 114 | .map(this.extractVideos) |