Browse Source

Merge pull request #1007 from Gelmir/fix_showrss

Fix RSS items not being marked read when the item is a magnet link.
adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
e50d5611f8
  1. 1
      src/qtlibtorrent/qbtsession.cpp
  2. 7
      src/rss/rssfeed.cpp

1
src/qtlibtorrent/qbtsession.cpp

@ -2747,6 +2747,7 @@ void QBtSession::addMagnetSkipAddDlg(const QString& uri, const QString& save_pat @@ -2747,6 +2747,7 @@ void QBtSession::addMagnetSkipAddDlg(const QString& uri, const QString& save_pat
if (!save_path.isEmpty() || !label.isEmpty())
savepathLabel_fromurl[uri] = qMakePair(save_path, label);
addMagnetUri(uri, false);
emit newDownloadedTorrentFromRss(uri);
}
void QBtSession::downloadUrlAndSkipDialog(QString url, QString save_path, QString label, const QList<QNetworkCookie>& cookies) {

7
src/rss/rssfeed.cpp

@ -355,14 +355,13 @@ void RssFeed::downloadArticleTorrentIfMatching(RssDownloadRuleList* rules, const @@ -355,14 +355,13 @@ void RssFeed::downloadArticleTorrentIfMatching(RssDownloadRuleList* rules, const
// Download the torrent
const QString& torrent_url = article->torrentUrl();
QBtSession::instance()->addConsoleMessage(tr("Automatically downloading %1 torrent from %2 RSS feed...").arg(article->title()).arg(displayName()));
if (torrent_url.startsWith("magnet:", Qt::CaseInsensitive))
QBtSession::instance()->addMagnetSkipAddDlg(torrent_url, matching_rule->savePath(), matching_rule->label());
else {
connect(QBtSession::instance(), SIGNAL(newDownloadedTorrentFromRss(QString)), article.data(), SLOT(handleTorrentDownloadSuccess(const QString&)), Qt::UniqueConnection);
connect(article.data(), SIGNAL(articleWasRead()), SLOT(handleArticleStateChanged()), Qt::UniqueConnection);
if (torrent_url.startsWith("magnet:", Qt::CaseInsensitive))
QBtSession::instance()->addMagnetSkipAddDlg(torrent_url, matching_rule->savePath(), matching_rule->label());
else
QBtSession::instance()->downloadUrlAndSkipDialog(torrent_url, matching_rule->savePath(), matching_rule->label(), feedCookies());
}
}
void RssFeed::recheckRssItemsForDownload()
{

Loading…
Cancel
Save