add option to show full post images in the rss feeds with full_thumbs query

This commit is contained in:
teddit 2021-03-27 16:58:56 +01:00
parent a143eeb2fe
commit 4790074c30

View File

@ -57,6 +57,9 @@ module.exports = function() {
if(is_self_link) if(is_self_link)
link.url = link.permalink link.url = link.permalink
if(req.query.hasOwnProperty('full_thumbs'))
thumbnail = post_image
let enclosure = '' let enclosure = ''
if(thumbnail != '') { if(thumbnail != '') {
let mime = '' let mime = ''
@ -68,11 +71,6 @@ module.exports = function() {
enclosure = `<enclosure length="0" type="${mime}" url="${thumbnail}" />` enclosure = `<enclosure length="0" type="${mime}" url="${thumbnail}" />`
} }
let image = ''
if(post_image != '') {
image = `<image>${post_image}</image>`
}
let append_desc_html = `<br/><a href="${link.url}">[link]</a> <a href="${link.permalink}">[comments]</a>` let append_desc_html = `<br/><a href="${link.url}">[link]</a> <a href="${link.permalink}">[comments]</a>`
items += ` items += `
@ -85,7 +83,6 @@ module.exports = function() {
<id>${link.id}</id> <id>${link.id}</id>
<thumbnail>${thumbnail}</thumbnail> <thumbnail>${thumbnail}</thumbnail>
${enclosure} ${enclosure}
${image}
<link>${link.permalink}</link> <link>${link.permalink}</link>
<url>${link.url}</url> <url>${link.url}</url>
<description><![CDATA[${unescape(link.selftext_html)}${append_desc_html}]]></description> <description><![CDATA[${unescape(link.selftext_html)}${append_desc_html}]]></description>