diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-04-17 00:49:04 +0200 |
---|---|---|
committer | Rigel <sendmemail@rigelk.eu> | 2018-04-17 01:09:06 +0200 |
commit | 244e76a552ef05a5067134b1065d26dd89246d8c (patch) | |
tree | a15fcd52bce99797fc9366572fea62a7a44aaabe /client/src/app/shared/video/abstract-video-list.ts | |
parent | c36d5a6b98056ef7fec3db43fbee880ee7332dcf (diff) | |
download | PeerTube-244e76a552ef05a5067134b1065d26dd89246d8c.tar.gz PeerTube-244e76a552ef05a5067134b1065d26dd89246d8c.tar.zst PeerTube-244e76a552ef05a5067134b1065d26dd89246d8c.zip |
feature: initial syndication feeds support
Provides rss 2.0, atom 1.0 and json 1.0 feeds for videos (instance and account-wide) on listings and video-watch views.
* still lacks redis caching
* still lacks lastBuildDate support
* still lacks channel-wide support
* still lacks semantic annotation (for licenses, NSFW warnings, etc.)
* still lacks love ( ˘ ³˘)
* RSS: has MRSS support for torrent lists!
* RSS: includes the first torrent in an enclosure
* JSON: lists all torrents in the 'attachments' object
* ATOM: lacking torrent listing support
Advances #23
Partial implementation for the accountId generation in the client, which will need a hotfix to add a way to get the proper account id.
Diffstat (limited to 'client/src/app/shared/video/abstract-video-list.ts')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index 1b9a519bd..024834dfc 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -3,6 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
3 | import { isInMobileView } from '@app/shared/misc/utils' | 3 | import { isInMobileView } from '@app/shared/misc/utils' |
4 | import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive' | 4 | import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive' |
5 | import { NotificationsService } from 'angular2-notifications' | 5 | import { NotificationsService } from 'angular2-notifications' |
6 | import { PopoverModule } from 'ngx-bootstrap/popover' | ||
6 | import 'rxjs/add/operator/debounceTime' | 7 | import 'rxjs/add/operator/debounceTime' |
7 | import { Observable } from 'rxjs/Observable' | 8 | import { Observable } from 'rxjs/Observable' |
8 | import { fromEvent } from 'rxjs/observable/fromEvent' | 9 | import { fromEvent } from 'rxjs/observable/fromEvent' |
@@ -11,6 +12,8 @@ import { AuthService } from '../../core/auth' | |||
11 | import { ComponentPagination } from '../rest/component-pagination.model' | 12 | import { ComponentPagination } from '../rest/component-pagination.model' |
12 | import { SortField } from './sort-field.type' | 13 | import { SortField } from './sort-field.type' |
13 | import { Video } from './video.model' | 14 | import { Video } from './video.model' |
15 | import { FeedFormat } from '../../../../../shared' | ||
16 | import { VideoFeedComponent } from '@app/shared/video/video-feed.component' | ||
14 | 17 | ||
15 | export abstract class AbstractVideoList implements OnInit, OnDestroy { | 18 | export abstract class AbstractVideoList implements OnInit, OnDestroy { |
16 | private static LINES_PER_PAGE = 4 | 19 | private static LINES_PER_PAGE = 4 |
@@ -25,6 +28,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
25 | } | 28 | } |
26 | sort: SortField = '-createdAt' | 29 | sort: SortField = '-createdAt' |
27 | defaultSort: SortField = '-createdAt' | 30 | defaultSort: SortField = '-createdAt' |
31 | syndicationItems = {} | ||
32 | |||
28 | loadOnInit = true | 33 | loadOnInit = true |
29 | pageHeight: number | 34 | pageHeight: number |
30 | videoWidth: number | 35 | videoWidth: number |
@@ -47,6 +52,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
47 | private resizeSubscription: Subscription | 52 | private resizeSubscription: Subscription |
48 | 53 | ||
49 | abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}> | 54 | abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}> |
55 | abstract generateSyndicationList () | ||
50 | 56 | ||
51 | get user () { | 57 | get user () { |
52 | return this.authService.getUser() | 58 | return this.authService.getUser() |