From 7a72e7588ba710fac82afdf1bea0db149be44b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Fri, 19 Jan 2024 16:44:12 +0100 Subject: [PATCH] Fix type propagation from the container folder --- YACReaderLibrary/db_helper.cpp | 6 ++++-- YACReaderLibrary/library_creator.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index d741455a..840c7264 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -1323,13 +1323,15 @@ qulonglong DBHelper::insert(ComicDB *comic, QSqlDatabase &db, bool insertAllInfo if (!comic->info.existOnDb) { QSqlQuery comicInfoInsert(db); - comicInfoInsert.prepare("INSERT INTO comic_info (hash,numPages,coverSizeRatio,originalCoverSize,added) " - "VALUES (:hash,:numPages,:coverSizeRatio,:originalCoverSize,:added)"); + comicInfoInsert.prepare("INSERT INTO comic_info (hash,numPages,coverSizeRatio,originalCoverSize,added,type) " + "VALUES (:hash,:numPages,:coverSizeRatio,:originalCoverSize,:added,:type)"); comicInfoInsert.bindValue(":hash", comic->info.hash); comicInfoInsert.bindValue(":numPages", comic->info.numPages); comicInfoInsert.bindValue(":coverSizeRatio", comic->info.coverSizeRatio); comicInfoInsert.bindValue(":originalCoverSize", comic->info.originalCoverSize); comicInfoInsert.bindValue(":added", added); + auto intType = static_cast(comic->info.type.value()); + comicInfoInsert.bindValue(":type", intType); comicInfoInsert.exec(); comic->info.id = comicInfoInsert.lastInsertId().toULongLong(); comic->info.added = added; diff --git a/YACReaderLibrary/library_creator.cpp b/YACReaderLibrary/library_creator.cpp index 2f3a4d86..c77ba1bb 100644 --- a/YACReaderLibrary/library_creator.cpp +++ b/YACReaderLibrary/library_creator.cpp @@ -361,7 +361,7 @@ void LibraryCreator::insertComic(const QString &relativePath, const QFileInfo &f } comic.parentId = _currentPathFolders.last().id; - comic.info.type = QVariant::fromValue(_currentPathFolders.last().type); // TODO_METADATA test this + comic.info.type = QVariant::fromValue(_currentPathFolders.last().type); DBHelper::insert(&comic, _database, parsed); }