From aa5e7008b2d82c862da1253862b8ec4755c5de3c Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 1 Jan 2020 12:57:50 +0100 Subject: [PATCH] Check for already posted guids in ProfileData::guids. --- src/document.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/document.cpp b/src/document.cpp index a01a07e..9829e65 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -161,7 +161,9 @@ void Document::parse_rss(const pt::ptree &tree) { guid = rssitem.get("link"); } - if (guid == _profiledata.last_guid) + if (any_of(_profiledata.guids.begin(), _profiledata.guids.end(), + [&](const auto &old_guid) + { return guid == old_guid; })) { BOOST_LOG_TRIVIAL(debug) << "Found already posted GUID, stopped parsing."; @@ -195,7 +197,7 @@ void Document::parse_rss(const pt::ptree &tree) BOOST_LOG_TRIVIAL(debug) << "Found GUID: " << item.guid; - if (_profiledata.last_guid.empty()) + if (_profiledata.guids.empty()) { BOOST_LOG_TRIVIAL(debug) << "This is the first run."; break;