mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 18:56:08 +03:00
- Make sure RSS Feed downloader does not process already-read articles
This commit is contained in:
parent
9b4cfa4a3d
commit
53171c81e1
1 changed files with 24 additions and 18 deletions
10
src/rss.cpp
10
src/rss.cpp
|
@ -561,11 +561,15 @@ short RssStream::readDoc(const QDomDocument& doc) {
|
||||||
image = property.text();
|
image = property.text();
|
||||||
else if(property.tagName() == "item") {
|
else if(property.tagName() == "item") {
|
||||||
RssItem * item = new RssItem(this, property);
|
RssItem * item = new RssItem(this, property);
|
||||||
if(item->isValid() && !itemAlreadyExists(item->getTitle())) {
|
if(item->isValid()) {
|
||||||
|
bool already_exists = itemAlreadyExists(item->getTitle());
|
||||||
|
if(!already_exists) {
|
||||||
(*this)[item->getTitle()] = item;
|
(*this)[item->getTitle()] = item;
|
||||||
|
}
|
||||||
if(item->has_attachment()) {
|
if(item->has_attachment()) {
|
||||||
has_attachments = true;
|
has_attachments = true;
|
||||||
// Check if the item should be automatically downloaded
|
// Check if the item should be automatically downloaded
|
||||||
|
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());
|
||||||
if(matching_filter != 0) {
|
if(matching_filter != 0) {
|
||||||
// Download the torrent
|
// Download the torrent
|
||||||
|
@ -581,11 +585,13 @@ short RssStream::readDoc(const QDomDocument& doc) {
|
||||||
BTSession->downloadUrlAndSkipDialog(item->getTorrentUrl());
|
BTSession->downloadUrlAndSkipDialog(item->getTorrentUrl());
|
||||||
}
|
}
|
||||||
// Item was downloaded, consider it as Read
|
// Item was downloaded, consider it as Read
|
||||||
item->setRead();
|
(*this)[item->getTitle()]->setRead();
|
||||||
// Clean up
|
// Clean up
|
||||||
delete matching_filter;
|
delete matching_filter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue