Skip to content

Commit

Permalink
fix #1280
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrotter committed Jan 23, 2024
1 parent cda0f79 commit f2b59b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librssguard/database/databasequeries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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());

Expand Down
4 changes: 4 additions & 0 deletions src/librssguard/services/standard/parsers/jsonparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f2b59b2

Please sign in to comment.