From e213a7665d2d831d3e2b4471d410771b664efbf9 Mon Sep 17 00:00:00 2001 From: Tom Hall Date: Sun, 26 May 2019 15:22:50 +0100 Subject: [PATCH] NewsDownloader: Fix createFromDescription for atom feeds (#5041) Atom feed content is found under the xml tag, 'content', not 'context'. The content field is a actually a table, with the text/html at [1]. --- plugins/newsdownloader.koplugin/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/newsdownloader.koplugin/main.lua b/plugins/newsdownloader.koplugin/main.lua index e68ec752a..71f50fa9c 100644 --- a/plugins/newsdownloader.koplugin/main.lua +++ b/plugins/newsdownloader.koplugin/main.lua @@ -276,7 +276,7 @@ function NewsDownloader:processAtom(feeds, limit, download_full_article, include if download_full_article then self:downloadFeed(feed, feed_output_dir, include_images, article_message) else - self:createFromDescription(feed, feed.context, feed_output_dir, include_images, article_message) + self:createFromDescription(feed, feed.content[1], feed_output_dir, include_images, article_message) end end end @@ -339,7 +339,7 @@ function NewsDownloader:downloadFeed(feed, feed_output_dir, include_images, mess end end -function NewsDownloader:createFromDescription(feed, context, feed_output_dir, include_images, message) +function NewsDownloader:createFromDescription(feed, content, feed_output_dir, include_images, message) local title_with_date = getTitleWithDate(feed) local news_file_path = ("%s%s%s"):format(feed_output_dir, title_with_date, @@ -358,7 +358,7 @@ function NewsDownloader:createFromDescription(feed, context, feed_output_dir, in

%s

%s

-]], feed.title, feed.title, context, footer) +]], feed.title, feed.title, content, footer) local link = getFeedLink(feed.link) DownloadBackend:createEpub(news_file_path, html, link, include_images, article_message) end