From 9c2d7adf554eb3f90dcaa78a22ac3c225228f279 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Mon, 15 Nov 2021 14:10:46 +0100 Subject: [PATCH] Add support for images from MRSS thumbnail tag --- src/updatefeedjob.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/updatefeedjob.cpp b/src/updatefeedjob.cpp index 2fb56fbc..3472c1b5 100644 --- a/src/updatefeedjob.cpp +++ b/src/updatefeedjob.cpp @@ -224,6 +224,11 @@ bool UpdateFeedJob::processEntry(Syndication::ItemPtr entry) // Retrieve "other" fields; this will include the "itunes" tags QMultiMap otherItems = entry->additionalProperties(); + for (QString key : otherItems.uniqueKeys()) { + qCDebug(kastsFetcher) << "other elements"; + qCDebug(kastsFetcher) << key << otherItems.value(key).tagName(); + } + // check against existing entries in database if (m_existingEntryIds.contains(entry->id())) return false; @@ -253,9 +258,12 @@ bool UpdateFeedJob::processEntry(Syndication::ItemPtr entry) // Look for image in itunes tags if (otherItems.value(QStringLiteral("http://www.itunes.com/dtds/podcast-1.0.dtdimage")).hasAttribute(QStringLiteral("href"))) { entryDetails.image = otherItems.value(QStringLiteral("http://www.itunes.com/dtds/podcast-1.0.dtdimage")).attribute(QStringLiteral("href")); + } else if (otherItems.contains(QStringLiteral("http://search.yahoo.com/mrss/thumbnail"))) { + entryDetails.image = otherItems.value(QStringLiteral("http://search.yahoo.com/mrss/thumbnail")).attribute(QStringLiteral("url")); } - if (entryDetails.image.startsWith(QStringLiteral("/"))) + if (entryDetails.image.startsWith(QStringLiteral("/"))) { entryDetails.image = QUrl(m_url).adjusted(QUrl::RemovePath).toString() + entryDetails.image; + } qCDebug(kastsFetcher) << "Entry image found" << entryDetails.image; m_entries += entryDetails;