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/videos/video-list/video-trending.component.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/videos/video-list/video-trending.component.ts')
-rw-r--r-- | client/src/app/videos/video-list/video-trending.component.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index 1dd1ad23b..905c75ab0 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -6,6 +6,8 @@ import { AuthService } from '../../core/auth' | |||
6 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 6 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' |
7 | import { SortField } from '../../shared/video/sort-field.type' | 7 | import { SortField } from '../../shared/video/sort-field.type' |
8 | import { VideoService } from '../../shared/video/video.service' | 8 | import { VideoService } from '../../shared/video/video.service' |
9 | import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' | ||
10 | import * as url from 'url' | ||
9 | 11 | ||
10 | @Component({ | 12 | @Component({ |
11 | selector: 'my-videos-trending', | 13 | selector: 'my-videos-trending', |
@@ -27,6 +29,7 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, | |||
27 | 29 | ||
28 | ngOnInit () { | 30 | ngOnInit () { |
29 | super.ngOnInit() | 31 | super.ngOnInit() |
32 | this.generateSyndicationList() | ||
30 | } | 33 | } |
31 | 34 | ||
32 | ngOnDestroy () { | 35 | ngOnDestroy () { |
@@ -37,4 +40,11 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, | |||
37 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 40 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
38 | return this.videoService.getVideos(newPagination, this.sort) | 41 | return this.videoService.getVideos(newPagination, this.sort) |
39 | } | 42 | } |
43 | |||
44 | generateSyndicationList () { | ||
45 | const feeds = this.videoService.getFeed('local') | ||
46 | this.syndicationItems['rss 2.0'] = feeds[FeedFormat.RSS] | ||
47 | this.syndicationItems['atom 1.0'] = feeds[FeedFormat.ATOM] | ||
48 | this.syndicationItems['json 1.0'] = feeds[FeedFormat.JSON] | ||
49 | } | ||
40 | } | 50 | } |