From 15619ed96cb4026a07819f2e457ef3bf98ac924b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sun, 7 Jan 2024 09:09:22 +0100 Subject: [PATCH] Load comic number when getting the comics currently being read --- YACReaderLibrary/db_helper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index c57d3dfe..3d8349dc 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -292,7 +292,7 @@ QList DBHelper::getReading(qulonglong libraryId) { QSqlDatabase db = DataBaseManagement::loadDatabase(libraryPath + "/.yacreaderlibrary"); QSqlQuery selectQuery(db); - selectQuery.prepare("SELECT c.id,c.parentId,c.fileName,ci.title,ci.currentPage,ci.numPages,ci.hash,ci.read,ci.coverSizeRatio " + selectQuery.prepare("SELECT c.id,c.parentId,c.fileName,ci.title,ci.currentPage,ci.numPages,ci.hash,ci.read,ci.coverSizeRatio,ci.number " "FROM comic c INNER JOIN comic_info ci ON (c.comicInfoId = ci.id) " "WHERE ci.hasBeenOpened = 1 AND ci.read = 0 " "ORDER BY ci.lastTimeOpened DESC"); @@ -301,6 +301,7 @@ QList DBHelper::getReading(qulonglong libraryId) while (selectQuery.next()) { ComicDB comic; + // TODO: use QVariant when possible to keep nulls comic.id = selectQuery.value(0).toULongLong(); comic.parentId = selectQuery.value(1).toULongLong(); comic.name = selectQuery.value(2).toString(); @@ -310,6 +311,7 @@ QList DBHelper::getReading(qulonglong libraryId) comic.info.hash = selectQuery.value(6).toString(); comic.info.read = selectQuery.value(7).toBool(); comic.info.coverSizeRatio = selectQuery.value(8).toFloat(); + comic.info.number = selectQuery.value(9); list.append(comic); }