RSS: Mark matched article as "read" if refers to duplicate torrent

PR #22477.
This commit is contained in:
Vladimir Golovnev 2025-03-28 09:01:22 +03:00 committed by Vladimir Golovnev (Glassez)
parent 9515ca59f2
commit 1da31bc2e1
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7

View file

@ -375,10 +375,24 @@ void AutoDownloader::handleTorrentAdded(const QString &source)
}
}
void AutoDownloader::handleAddTorrentFailed(const QString &source, [[maybe_unused]] const BitTorrent::AddTorrentError &error)
void AutoDownloader::handleAddTorrentFailed(const QString &source, const BitTorrent::AddTorrentError &error)
{
m_waitingJobs.remove(source);
// TODO: Re-schedule job here.
const auto job = m_waitingJobs.take(source);
if (!job)
return;
if (error.kind == BitTorrent::AddTorrentError::DuplicateTorrent)
{
if (Feed *feed = Session::instance()->feedByURL(job->feedURL))
{
if (Article *article = feed->articleByGUID(job->articleData.value(Article::KeyId).toString()))
article->markAsRead();
}
}
else
{
// TODO: Re-schedule job here.
}
}
void AutoDownloader::handleNewArticle(const Article *article)