Improve RSS Feed updating

Don't process "out-of-limit" articles.
Closes #9833.
This commit is contained in:
Vladimir Golovnev (Glassez) 2018-11-12 12:15:41 +03:00
parent ceb4a0d5fe
commit 64d7cf4794
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
4 changed files with 101 additions and 63 deletions

View file

@ -30,7 +30,6 @@
#include "rss_article.h"
#include <stdexcept>
#include <QJsonObject>
#include <QVariant>
@ -73,23 +72,6 @@ Article::Article(Feed *feed, const QVariantHash &varHash)
, m_isRead(varHash.value(KeyIsRead, false).toBool())
, m_data(varHash)
{
if (!m_date.isValid())
throw std::runtime_error("Bad RSS Article data");
// If item does not have a guid, fall back to some other identifier
if (m_guid.isEmpty())
m_guid = varHash.value(KeyTorrentURL).toString();
if (m_guid.isEmpty())
m_guid = varHash.value(KeyTitle).toString();
if (m_guid.isEmpty())
throw std::runtime_error("Bad RSS Article data");
m_data[KeyId] = m_guid;
if (m_torrentURL.isEmpty()) {
m_torrentURL = m_link;
m_data[KeyTorrentURL] = m_torrentURL;
}
}
Article::Article(Feed *feed, const QJsonObject &jsonObj)