From 39ba2e8e3a71961cd0087c57d25905f6a97a6b69 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Sep 2018 09:39:41 +0200 Subject: Add RSS feed to subscribe button --- .../shared/user-subscription/subscribe-button.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/user-subscription/subscribe-button.component.ts') diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.ts b/client/src/app/shared/user-subscription/subscribe-button.component.ts index e3c758942..95c2bb8f8 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/user-subscription/subscribe-button.component.ts @@ -5,6 +5,8 @@ import { UserSubscriptionService } from '@app/shared/user-subscription/user-subs import { VideoChannel } from '@app/shared/video-channel/video-channel.model' import { NotificationsService } from 'angular2-notifications' import { I18n } from '@ngx-translate/i18n-polyfill' +import { VideoService } from '@app/shared/video/video.service' +import { FeedFormat } from '../../../../../shared/models/feeds' @Component({ selector: 'my-subscribe-button', @@ -23,7 +25,8 @@ export class SubscribeButtonComponent implements OnInit { private router: Router, private notificationsService: NotificationsService, private userSubscriptionService: UserSubscriptionService, - private i18n: I18n + private i18n: I18n, + private videoService: VideoService ) { } get uri () { @@ -100,6 +103,10 @@ export class SubscribeButtonComponent implements OnInit { } rssOpen () { - window.open('') + const rssFeed = this.videoService + .getVideoChannelFeedUrls(this.videoChannel.id) + .find(i => i.format === FeedFormat.RSS) + + window.open(rssFeed.url) } } -- cgit v1.2.3