Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add podcast feed to subscribe button

Chocobozzz84abb552a52a
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index a586d9fcaf..e73ce35f6e 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -279,7 +279,7 @@ export class VideoService {
const feedUrls = this.buildBaseFeedUrls(params)
feedUrls.push({
- format: FeedFormat.RSS,
+ format: FeedFormat.PODCAST,
label: 'podcast rss 2.0',
url: VideoService.PODCAST_FEEDS_URL + `?videoChannelId=${videoChannelId}`
})
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
index d6dac63938..38c85896e7 100644
--- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
@@ -61,6 +61,7 @@
<div class="dropdown-divider"></div>
<h6 class="dropdown-header" i18n>Using a syndication feed</h6>
+ <a *ngIf="podcastFeedUri" [href]="podcastFeedUri" target="_blank" class="dropdown-item" i18n>Subscribe via Podcast Feed</a>
<a [href]="rssUri" target="_blank" class="dropdown-item" i18n>Subscribe via RSS</a>
</div>
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
index 2d1c98019b..6010b3325b 100644
--- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
@@ -67,6 +67,7 @@ export class SubscribeButtonComponent implements OnChanges {
get rssUri () {
const account = this.account()
+
const rssFeed = account
? this.videoService
.getAccountFeedUrls(account.id)
@@ -78,6 +79,15 @@ export class SubscribeButtonComponent implements OnChanges {
return rssFeed.url
}
+ get podcastFeedUri () {
+ return this.account()
+ ? undefined
+ : this.videoService
+ .getVideoChannelFeedUrls(this.videoChannels()[0].id)
+ .find(i => i.format === FeedFormat.PODCAST)
+ .url
+ }
+
get videoChannel () {
return this.videoChannels()[0]
}
diff --git a/packages/models/src/feeds/feed-format.enum.ts b/packages/models/src/feeds/feed-format.enum.ts
index 71f2f6c15f..46042359e5 100644
--- a/packages/models/src/feeds/feed-format.enum.ts
+++ b/packages/models/src/feeds/feed-format.enum.ts
@@ -1,4 +1,5 @@
export const FeedFormat = {
+ PODCAST: 'xml',
RSS: 'xml',
ATOM: 'atom',
JSON: 'json'