From a55d504017903365b1aa0952ac33703a48515950 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 11 Aug 2020 17:43:31 +0200 Subject: [PATCH] Fix getArticleCount. With #403, the article mimetype may be different than "text/html". It can also be "text/html; raw=true". (And in fact it already could have any kind of optional argument). --- src/reader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index 2188cca01..8d6b5a471 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -138,9 +138,10 @@ unsigned int Reader::getArticleCount() const if (counterMap.empty()) { counter = this->nsACount; } else { - auto it = counterMap.find("text/html"); - if (it != counterMap.end()) { - counter = it->second; + for(auto &pair:counterMap) { + if (startsWith(pair.first, "text/html")) { + counter += pair.second; + } } }