log error when editing feed, fix minimal interval for feed update on SQL level

This commit is contained in:
Martin Rotter 2019-06-07 07:53:14 +02:00
parent d347ba6307
commit 0ac2b9f238
4 changed files with 18 additions and 7 deletions

View File

@ -30,7 +30,7 @@
<url type="donation">https://martinrotter.github.io/donate/</url>
<content_rating type="oars-1.1" />
<releases>
<release version="3.5.9" date="2019-06-06"/>
<release version="3.5.9" date="2019-06-07"/>
</releases>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>

View File

@ -97,7 +97,7 @@ CREATE TABLE IF NOT EXISTS Feeds (
username TEXT,
password TEXT,
update_type INTEGER(1) NOT NULL CHECK (update_type >= 0),
update_interval INTEGER NOT NULL DEFAULT 15 CHECK (update_interval >= 5),
update_interval INTEGER NOT NULL DEFAULT 15 CHECK (update_interval >= 3),
type INTEGER,
account_id INTEGER NOT NULL,
custom_id TEXT,

View File

@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS Feeds (
username TEXT,
password TEXT,
update_type INTEGER(1) NOT NULL CHECK (update_type >= 0),
update_interval INTEGER NOT NULL CHECK (update_interval >= 5) DEFAULT 15,
update_interval INTEGER NOT NULL CHECK (update_interval >= 3) DEFAULT 15,
type INTEGER,
account_id INTEGER NOT NULL,
custom_id TEXT,

View File

@ -168,8 +168,11 @@ bool DatabaseQueries::purgeRecycleBin(const QSqlDatabase& db) {
return q.exec();
}
QMap<QString, QPair<int, int>> DatabaseQueries::getMessageCountsForCategory(const QSqlDatabase& db, const QString& custom_id, int account_id,
bool including_total_counts, bool* ok) {
QMap<QString, QPair<int, int>> DatabaseQueries::getMessageCountsForCategory(const QSqlDatabase& db,
const QString& custom_id,
int account_id,
bool including_total_counts,
bool* ok) {
QMap<QString, QPair<int, int>> counts;
QSqlQuery q(db);
@ -331,7 +334,8 @@ int DatabaseQueries::getMessageCountsForBin(const QSqlDatabase& db, int account_
}
}
QList<Message> DatabaseQueries::getUndeletedMessagesForFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id, bool* ok) {
QList<Message> DatabaseQueries::getUndeletedMessagesForFeed(const QSqlDatabase& db, const QString& feed_custom_id, int account_id,
bool* ok) {
QList<Message> messages;
QSqlQuery q(db);
@ -1268,7 +1272,14 @@ bool DatabaseQueries::editFeed(const QSqlDatabase& db, int parent_id, int feed_i
q.bindValue(QSL(":update_interval"), auto_update_interval);
q.bindValue(QSL(":type"), feed_format);
q.bindValue(QSL(":id"), feed_id);
return q.exec();
bool suc = q.exec();
if (!suc) {
qCritical("There was error when editing feed: %s", qPrintable(q.lastError().text()));
}
return suc;
}
bool DatabaseQueries::editBaseFeed(const QSqlDatabase& db, int feed_id, Feed::AutoUpdateType auto_update_type,