mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-29 19:18:42 -07:00
Use RSS feed update time as a fallback
Some sites omit publication date in its RSS feed articles that prevents "Ignore Subsequent Matches" to work properly. Closes #8959.
This commit is contained in:
parent
1b14706b08
commit
9b80c4f7eb
2 changed files with 24 additions and 5 deletions
|
@ -212,7 +212,13 @@ void Feed::handleParsingFinished(const RSS::Private::ParsingResult &result)
|
|||
m_lastBuildDate = result.lastBuildDate;
|
||||
|
||||
int newArticlesCount = 0;
|
||||
for (const QVariantHash &varHash : result.articles) {
|
||||
const QDateTime now {QDateTime::currentDateTime()};
|
||||
for (QVariantHash varHash : result.articles) {
|
||||
// if article has no publication date we use feed update time as a fallback
|
||||
QVariant &articleDate = varHash[Article::KeyDate];
|
||||
if (!articleDate.toDateTime().isValid())
|
||||
articleDate = now;
|
||||
|
||||
try {
|
||||
auto article = new Article(this, varHash);
|
||||
if (addArticle(article))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue