diff options
author | Brad Johnson <bradsk88@gmail.com> | 2018-08-31 09:19:21 -0600 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-31 17:19:21 +0200 |
commit | 7f5f4152a4cd4fc328d6ae177d281ebe7e792dd3 (patch) | |
tree | fd0401bd9c43e1adbbedbd2042c93bd4fef46632 /client/src/app/shared | |
parent | 1a4710914432b44115b185cec1883fdf409aef1d (diff) | |
download | PeerTube-7f5f4152a4cd4fc328d6ae177d281ebe7e792dd3.tar.gz PeerTube-7f5f4152a4cd4fc328d6ae177d281ebe7e792dd3.tar.zst PeerTube-7f5f4152a4cd4fc328d6ae177d281ebe7e792dd3.zip |
Refactor: Separated "Other Videos" section into a dedicated component/service (#969)
* Separated "Other Videos" section into a dedicated component/service
I'm currently working on some proof-of-concepts for recommendation
providers that could work with PeerTube to provide useful video
suggestions to the user.
As a first step, I want to have great clarity about how PeerTube,
itself, will surface these videos to the user.
With this branch, I'm refactoring the "recommendations" to make it
easier to swap out different recommender implementations quickly.
Stop recommender from including the video that's being watched.
Ensure always 5 recommendations
* Treat recommendations as a stream of values, rather than a single async value.
* Prioritize readability over HTTP response size early-optimization.
* Simplify pipe
Diffstat (limited to 'client/src/app/shared')
-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 7cc98c77a..5c0674e58 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -23,8 +23,17 @@ import { ServerService } from '@app/core' | |||
23 | import { UserSubscriptionService } from '@app/shared/user-subscription' | 23 | import { UserSubscriptionService } from '@app/shared/user-subscription' |
24 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 24 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
25 | 25 | ||
26 | export interface VideosProvider { | ||
27 | getVideos ( | ||
28 | videoPagination: ComponentPagination, | ||
29 | sort: VideoSortField, | ||
30 | filter?: VideoFilter, | ||
31 | categoryOneOf?: number | ||
32 | ): Observable<{ videos: Video[], totalVideos: number }> | ||
33 | } | ||
34 | |||
26 | @Injectable() | 35 | @Injectable() |
27 | export class VideoService { | 36 | export class VideoService implements VideosProvider { |
28 | static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' | 37 | static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' |
29 | static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' | 38 | static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' |
30 | 39 | ||