|
|
@ -376,7 +376,6 @@ void RssManager::saveStreamList(){ |
|
|
|
/** RssStream **/ |
|
|
|
/** RssStream **/ |
|
|
|
|
|
|
|
|
|
|
|
RssStream::RssStream(RssFolder* parent, RssManager *rssmanager, Bittorrent *BTSession, QString _url): parent(parent), rssmanager(rssmanager), BTSession(BTSession), alias(""), iconPath(":/Icons/rss16.png"), refreshed(false), downloadFailure(false), currently_loading(false) { |
|
|
|
RssStream::RssStream(RssFolder* parent, RssManager *rssmanager, Bittorrent *BTSession, QString _url): parent(parent), rssmanager(rssmanager), BTSession(BTSession), alias(""), iconPath(":/Icons/rss16.png"), refreshed(false), downloadFailure(false), currently_loading(false) { |
|
|
|
has_attachments = false; |
|
|
|
|
|
|
|
qDebug("RSSStream constructed"); |
|
|
|
qDebug("RSSStream constructed"); |
|
|
|
QSettings qBTRSS("qBittorrent", "qBittorrent-rss"); |
|
|
|
QSettings qBTRSS("qBittorrent", "qBittorrent-rss"); |
|
|
|
url = QUrl(_url).toString(); |
|
|
|
url = QUrl(_url).toString(); |
|
|
@ -388,8 +387,6 @@ RssStream::RssStream(RssFolder* parent, RssManager *rssmanager, Bittorrent *BTSe |
|
|
|
RssItem *rss_item = RssItem::fromHash(this, item); |
|
|
|
RssItem *rss_item = RssItem::fromHash(this, item); |
|
|
|
if(rss_item->isValid()) { |
|
|
|
if(rss_item->isValid()) { |
|
|
|
(*this)[rss_item->getTitle()] = rss_item; |
|
|
|
(*this)[rss_item->getTitle()] = rss_item; |
|
|
|
if(rss_item->has_attachment()) |
|
|
|
|
|
|
|
has_attachments = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -584,8 +581,11 @@ short RssStream::readDoc(const QDomDocument& doc) { |
|
|
|
delete item; |
|
|
|
delete item; |
|
|
|
item = this->value(title); |
|
|
|
item = this->value(title); |
|
|
|
} |
|
|
|
} |
|
|
|
if(item->has_attachment()) { |
|
|
|
QString torrent_url; |
|
|
|
has_attachments = true; |
|
|
|
if(item->has_attachment()) |
|
|
|
|
|
|
|
torrent_url = item->getTorrentUrl(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
torrent_url = item->getLink(); |
|
|
|
// Check if the item should be automatically downloaded
|
|
|
|
// Check if the item should be automatically downloaded
|
|
|
|
if(!already_exists || !(*this)[item->getTitle()]->isRead()) { |
|
|
|
if(!already_exists || !(*this)[item->getTitle()]->isRead()) { |
|
|
|
FeedFilter * matching_filter = FeedFilters::getFeedFilters(url).matches(item->getTitle()); |
|
|
|
FeedFilter * matching_filter = FeedFilters::getFeedFilters(url).matches(item->getTitle()); |
|
|
@ -595,12 +595,12 @@ short RssStream::readDoc(const QDomDocument& doc) { |
|
|
|
if(matching_filter->isValid()) { |
|
|
|
if(matching_filter->isValid()) { |
|
|
|
QString save_path = matching_filter->getSavePath(); |
|
|
|
QString save_path = matching_filter->getSavePath(); |
|
|
|
if(save_path.isEmpty()) |
|
|
|
if(save_path.isEmpty()) |
|
|
|
BTSession->downloadUrlAndSkipDialog(item->getTorrentUrl()); |
|
|
|
BTSession->downloadUrlAndSkipDialog(torrent_url); |
|
|
|
else |
|
|
|
else |
|
|
|
BTSession->downloadUrlAndSkipDialog(item->getTorrentUrl(), save_path); |
|
|
|
BTSession->downloadUrlAndSkipDialog(torrent_url, save_path); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// All torrents are downloaded from this feed
|
|
|
|
// All torrents are downloaded from this feed
|
|
|
|
BTSession->downloadUrlAndSkipDialog(item->getTorrentUrl()); |
|
|
|
BTSession->downloadUrlAndSkipDialog(torrent_url); |
|
|
|
} |
|
|
|
} |
|
|
|
// Item was downloaded, consider it as Read
|
|
|
|
// Item was downloaded, consider it as Read
|
|
|
|
(*this)[item->getTitle()]->setRead(); |
|
|
|
(*this)[item->getTitle()]->setRead(); |
|
|
@ -608,7 +608,6 @@ short RssStream::readDoc(const QDomDocument& doc) { |
|
|
|
delete matching_filter; |
|
|
|
delete matching_filter; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
delete item; |
|
|
|
delete item; |
|
|
|