From 11df4a9b427eec932489ba2260287502be0267e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 20 May 2023 16:14:30 +0200 Subject: [PATCH] Update inserted folders with the added date --- YACReaderLibrary/db_helper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index b23494b1..201a48da 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -1232,13 +1232,16 @@ void DBHelper::updateComicsInfo(QList &comics, const QString &databaseP // inserts qulonglong DBHelper::insert(Folder *folder, QSqlDatabase &db) { + auto added = QDateTime::currentSecsSinceEpoch(); + folder->added = added; + QSqlQuery query(db); query.prepare("INSERT INTO folder (parentId, name, path, added) " "VALUES (:parentId, :name, :path, :added)"); query.bindValue(":parentId", folder->parentId); query.bindValue(":name", folder->name); query.bindValue(":path", folder->path); - query.bindValue(":added", QDateTime::currentSecsSinceEpoch()); + query.bindValue(":added", added); query.exec(); return query.lastInsertId().toULongLong();