Fix bools in database

This commit is contained in:
Tobias Fella 2020-08-22 21:48:32 +02:00
parent b412325219
commit 86621fe7d6
2 changed files with 2 additions and 2 deletions

View File

@ -145,7 +145,7 @@ int Feed::entryCount() const
int Feed::unreadEntryCount() const
{
QSqlQuery query;
query.prepare(QStringLiteral("SELECT COUNT (id) FROM Entries where feed=:feed AND read=false;"));
query.prepare(QStringLiteral("SELECT COUNT (id) FROM Entries where feed=:feed AND read=0;"));
query.bindValue(QStringLiteral(":feed"), m_url);
Database::instance().execute(query);
if (!query.next())

View File

@ -108,7 +108,7 @@ void Fetcher::processEntry(Syndication::ItemPtr entry, QString url)
if (query.value(0).toInt() != 0)
return;
query.prepare(QStringLiteral("INSERT INTO Entries VALUES (:feed, :id, :title, :content, :created, :updated, :link, false);"));
query.prepare(QStringLiteral("INSERT INTO Entries VALUES (:feed, :id, :title, :content, :created, :updated, :link, 0);"));
query.bindValue(QStringLiteral(":feed"), url);
query.bindValue(QStringLiteral(":id"), entry->id());
query.bindValue(QStringLiteral(":title"), QTextDocumentFragment::fromHtml(entry->title()).toPlainText());