mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 13:11:25 -07:00
Improve RSS Feed updating
Don't process "out-of-limit" articles. Closes #9833.
This commit is contained in:
parent
ceb4a0d5fe
commit
64d7cf4794
4 changed files with 101 additions and 63 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue