mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-30 20:28:05 -06:00
Perform more RSS parsing in working thread
This commit is contained in:
@@ -635,7 +635,7 @@ void Parser::parseRssArticle(QXmlStreamReader &xml)
|
||||
if (article[Article::KeyTorrentURL].toString().isEmpty())
|
||||
article[Article::KeyTorrentURL] = altTorrentUrl;
|
||||
|
||||
m_result.articles.prepend(article);
|
||||
addArticle(article);
|
||||
}
|
||||
|
||||
void Parser::parseRSSChannel(QXmlStreamReader &xml)
|
||||
@@ -730,7 +730,7 @@ void Parser::parseAtomArticle(QXmlStreamReader &xml)
|
||||
}
|
||||
}
|
||||
|
||||
m_result.articles.prepend(article);
|
||||
addArticle(article);
|
||||
}
|
||||
|
||||
void Parser::parseAtomChannel(QXmlStreamReader &xml)
|
||||
@@ -760,3 +760,20 @@ void Parser::parseAtomChannel(QXmlStreamReader &xml)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Parser::addArticle(QVariantHash article)
|
||||
{
|
||||
QVariant &torrentURL = article[Article::KeyTorrentURL];
|
||||
if (torrentURL.toString().isEmpty())
|
||||
torrentURL = article[Article::KeyLink];
|
||||
|
||||
// If item does not have an ID, fall back to some other identifier.
|
||||
QVariant &localId = article[Article::KeyId];
|
||||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTorrentURL);
|
||||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTitle);
|
||||
|
||||
if (!localId.toString().isEmpty())
|
||||
m_result.articles.prepend(article);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user