fix #1280
This commit is contained in:
parent
cda0f79e11
commit
f2b59b2836
2 changed files with 6 additions and 0 deletions
|
@ -564,6 +564,7 @@ bool DatabaseQueries::removeUnwantedArticlesFromFeed(const QSqlDatabase& db,
|
||||||
// No articles will be removed, quitting.
|
// No articles will be removed, quitting.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We find datetime stamp of oldest article which will be NOT moved/removed.
|
// We find datetime stamp of oldest article which will be NOT moved/removed.
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
|
|
||||||
|
@ -576,6 +577,7 @@ bool DatabaseQueries::removeUnwantedArticlesFromFeed(const QSqlDatabase& db,
|
||||||
" Messages.is_pdeleted = 0 "
|
" Messages.is_pdeleted = 0 "
|
||||||
"ORDER BY Messages.date_created DESC "
|
"ORDER BY Messages.date_created DESC "
|
||||||
"LIMIT 1 OFFSET :offset;"));
|
"LIMIT 1 OFFSET :offset;"));
|
||||||
|
|
||||||
q.bindValue(QSL(":offset"), amount_to_keep - 1);
|
q.bindValue(QSL(":offset"), amount_to_keep - 1);
|
||||||
q.bindValue(QSL(":feed"), feed->customId());
|
q.bindValue(QSL(":feed"), feed->customId());
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,10 @@ QPair<StandardFeed*, QList<IconLocation>> JsonParser::guessFeed(const QByteArray
|
||||||
throw FeedRecognizedButFailedException(QObject::tr("JSON error '%1'").arg(json_err.errorString()));
|
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();
|
auto* feed = new StandardFeed();
|
||||||
QList<IconLocation> icon_possible_locations;
|
QList<IconLocation> icon_possible_locations;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue