From 244e76a552ef05a5067134b1065d26dd89246d8c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 17 Apr 2018 00:49:04 +0200 Subject: feature: initial syndication feeds support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- client/src/app/videos/video-list/video-local.component.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client/src/app/videos/video-list/video-local.component.ts') diff --git a/client/src/app/videos/video-list/video-local.component.ts b/client/src/app/videos/video-list/video-local.component.ts index 8f9d50a7b..9d626abd1 100644 --- a/client/src/app/videos/video-list/video-local.component.ts +++ b/client/src/app/videos/video-list/video-local.component.ts @@ -3,9 +3,12 @@ import { ActivatedRoute, Router } from '@angular/router' import { immutableAssign } from '@app/shared/misc/utils' import { NotificationsService } from 'angular2-notifications' import { AuthService } from '../../core/auth' +import { PopoverModule } from 'ngx-bootstrap/popover' import { AbstractVideoList } from '../../shared/video/abstract-video-list' import { SortField } from '../../shared/video/sort-field.type' import { VideoService } from '../../shared/video/video.service' +import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' +import * as url from 'url' @Component({ selector: 'my-videos-local', @@ -27,6 +30,7 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On ngOnInit () { super.ngOnInit() + this.generateSyndicationList() } ngOnDestroy () { @@ -38,4 +42,11 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On return this.videoService.getVideos(newPagination, this.sort, 'local') } + + generateSyndicationList () { + const feeds = this.videoService.getFeed('local') + this.syndicationItems['rss 2.0'] = feeds[FeedFormat.RSS] + this.syndicationItems['atom 1.0'] = feeds[FeedFormat.ATOM] + this.syndicationItems['json 1.0'] = feeds[FeedFormat.JSON] + } } -- cgit v1.2.3