private videoService: VideoService
) { }
- get uri () {
+ get channelHandle () {
return this.videoChannel.name + '@' + this.videoChannel.host
}
- get uriAccount () {
- return this.videoChannel.ownerAccount.name + '@' + this.videoChannel.host
+ get channelUri () {
+ return this.videoChannel.url
+ }
+
+ get rssUri () {
+ const rssFeed = this.videoService
+ .getVideoChannelFeedUrls(this.videoChannel.id)
+ .find(i => i.format === FeedFormat.RSS)
+
+ return rssFeed.url
}
ngOnInit () {
if (this.isUserLoggedIn()) {
- this.userSubscriptionService.isSubscriptionExists(this.uri)
+ this.userSubscriptionService.doesSubscriptionExist(this.channelHandle)
.subscribe(
- res => this.subscribed = res[this.uri],
+ res => this.subscribed = res[this.channelHandle],
err => this.notifier.error(err.message)
)
}
localSubscribe () {
- this.userSubscriptionService.addSubscription(this.uri)
+ this.userSubscriptionService.addSubscription(this.channelHandle)
.subscribe(
() => {
this.subscribed = true
this.notifier.success(
- this.i18n('Subscribed to {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }),
+ this.i18n('Subscribed to {{nameWithHost}}. You will be notified of all their new videos.',
+ { nameWithHost: this.videoChannel.displayName }
+ ),
this.i18n('Subscribed')
)
},
}
localUnsubscribe () {
- this.userSubscriptionService.deleteSubscription(this.uri)
+ this.userSubscriptionService.deleteSubscription(this.channelHandle)
.subscribe(
() => {
this.subscribed = false
gotoLogin () {
this.router.navigate([ '/login' ])
}
-
- rssOpen () {
- const rssFeed = this.videoService
- .getVideoChannelFeedUrls(this.videoChannel.id)
- .find(i => i.format === FeedFormat.RSS)
-
- window.open(rssFeed.url)
- }
}