This commit is contained in:
Martin Rotter 2024-01-23 10:13:27 +01:00
parent cda0f79e11
commit f2b59b2836
2 changed files with 6 additions and 0 deletions

View file

@ -564,6 +564,7 @@ bool DatabaseQueries::removeUnwantedArticlesFromFeed(const QSqlDatabase& db,
// No articles will be removed, quitting.
return false;
}
// We find datetime stamp of oldest article which will be NOT moved/removed.
QSqlQuery q(db);
@ -576,6 +577,7 @@ bool DatabaseQueries::removeUnwantedArticlesFromFeed(const QSqlDatabase& db,
" Messages.is_pdeleted = 0 "
"ORDER BY Messages.date_created DESC "
"LIMIT 1 OFFSET :offset;"));
q.bindValue(QSL(":offset"), amount_to_keep - 1);
q.bindValue(QSL(":feed"), feed->customId());

View file

@ -123,6 +123,10 @@ QPair<StandardFeed*, QList<IconLocation>> JsonParser::guessFeed(const QByteArray
throw FeedRecognizedButFailedException(QObject::tr("JSON error '%1'").arg(json_err.errorString()));
}
if (!json.object().contains(QSL("version"))) {
throw ApplicationException(QObject::tr("not a JSON feed"));
}
auto* feed = new StandardFeed();
QList<IconLocation> icon_possible_locations;