Check for already posted guids in ProfileData::guids.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tastytea 2020-01-01 12:57:50 +01:00
parent cfe57f1931
commit aa5e7008b2
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -161,7 +161,9 @@ void Document::parse_rss(const pt::ptree &tree)
{
guid = rssitem.get<string>("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;