mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 15:32:48 -07:00
Ignore RSS articles with non-unique identifiers
This commit is contained in:
parent
d710bbd9ef
commit
68ee071331
2 changed files with 19 additions and 2 deletions
|
@ -583,6 +583,7 @@ void Parser::parse_impl(const QByteArray &feedData)
|
|||
|
||||
emit finished(m_result);
|
||||
m_result.articles.clear(); // clear articles only
|
||||
m_articleIDs.clear();
|
||||
}
|
||||
|
||||
void Parser::parseRssArticle(QXmlStreamReader &xml)
|
||||
|
@ -774,6 +775,20 @@ void Parser::addArticle(QVariantHash article)
|
|||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTitle);
|
||||
|
||||
if (!localId.toString().isEmpty())
|
||||
m_result.articles.prepend(article);
|
||||
if (localId.toString().isEmpty()) {
|
||||
// The article could not be uniquely identified
|
||||
// since it has no appropriate data.
|
||||
// Just ignore it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_articleIDs.contains(localId.toString())) {
|
||||
// The article could not be uniquely identified
|
||||
// since the Feed has duplicate identifiers.
|
||||
// Just ignore it.
|
||||
return;
|
||||
}
|
||||
|
||||
m_articleIDs.insert(localId.toString());
|
||||
m_result.articles.prepend(article);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue