From c34840a4d4def2cca2b5205dfecd920f44e58811 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Sun, 13 Feb 2022 15:25:18 -0500 Subject: [PATCH] Fix some RSS issues --- ui/util/web.js | 2 +- web/src/rss.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/util/web.js b/ui/util/web.js index 4ed87f91a..ab9413dce 100644 --- a/ui/util/web.js +++ b/ui/util/web.js @@ -6,7 +6,7 @@ function generateStreamUrl(claimName, claimId) { return `${LBRY_WEB_STREAMING_API}/content/claims/${encodeURIComponent(claimName) .replace(/'/g, '%27') .replace(/\(/g, '%28') - .replace(/\)/g, '%29')}/${claimId}/stream`; + .replace(/\)/g, '%29')}/${claimId}/${encodeURIComponent(claimName)}`; } function generateEmbedUrl(claimName, claimId, startTime, referralLink) { diff --git a/web/src/rss.js b/web/src/rss.js index 8b6849704..35df98a05 100644 --- a/web/src/rss.js +++ b/web/src/rss.js @@ -218,11 +218,12 @@ const getFormattedDescription = (claim) => replaceLineFeeds(claim.value.descript function generateFeed(feedLink, channelClaim, claimsInChannel) { // --- Channel --- let channelTitle = (channelClaim.value && channelClaim.value.title) || channelClaim.name; + let channelURL = URL + '/' + channelClaim.canonical_url.replace('lbry://', '').replace(/#/g, ':'); const feed = new Rss({ title: channelTitle + ' on ' + SITE_NAME, description: getFormattedDescription(channelClaim), feed_url: feedLink, - site_url: (channelClaim.value && channelClaim.value.website_url) || URL, + site_url: (channelClaim.value && channelClaim.value.website_url) || channelURL, image_url: (channelClaim.value && channelClaim.value.thumbnail && channelClaim.value.thumbnail.url) || undefined, language: getLanguageValue(channelClaim), custom_namespaces: { itunes: 'http://www.itunes.com/dtds/podcast-1.0.dtd' }, @@ -253,7 +254,8 @@ function generateFeed(feedLink, channelClaim, claimsInChannel) { const description = thumbnailHtml + getFormattedDescription(c); const url = `${URL}/${encodeWithSpecialCharEncode(c.name)}:${c.claim_id}`; - const date = c.release_time ? c.release_time * 1000 : c.meta && c.meta.creation_timestamp * 1000; + const date = + c.value && c.value.release_time ? c.value.release_time * 1000 : c.meta && c.meta.creation_timestamp * 1000; feed.item({ title: title,