From f11824ea2b319f17eefdeba1b6c09ddbffb7e58b Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 3 Dec 2020 08:47:52 +0100 Subject: [PATCH] Try to parse "image" and "logo", "icon" when guessing a feed. --- .../services/standard/standardfeed.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/librssguard/services/standard/standardfeed.cpp b/src/librssguard/services/standard/standardfeed.cpp index 44af3ba9d..bcb1ef019 100644 --- a/src/librssguard/services/standard/standardfeed.cpp +++ b/src/librssguard/services/standard/standardfeed.cpp @@ -264,6 +264,13 @@ QPair StandardFeed::guessFeed(const result.first->setTitle(channel_element.namedItem(QSL("title")).toElement().text()); result.first->setDescription(channel_element.namedItem(QSL("description")).toElement().text()); + + QString icon_link = channel_element.namedItem(QSL("image")).toElement().text(); + + if (!icon_link.isEmpty()) { + icon_possible_locations.prepend(icon_link); + } + QString source_link = channel_element.namedItem(QSL("link")).toElement().text(); if (!source_link.isEmpty()) { @@ -275,6 +282,19 @@ QPair StandardFeed::guessFeed(const result.first->setType(Type::Atom10); result.first->setTitle(root_element.namedItem(QSL("title")).toElement().text()); result.first->setDescription(root_element.namedItem(QSL("subtitle")).toElement().text()); + + QString icon_link = root_element.namedItem(QSL("icon")).toElement().text(); + + if (!icon_link.isEmpty()) { + icon_possible_locations.prepend(icon_link); + } + + QString logo_link = root_element.namedItem(QSL("logo")).toElement().text(); + + if (!logo_link.isEmpty()) { + icon_possible_locations.prepend(logo_link); + } + QString source_link = root_element.namedItem(QSL("link")).toElement().text(); if (!source_link.isEmpty()) {