From 053d97d39f85cb85dffde6ac25463279cc989804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 21 Jun 2014 14:50:26 +0200 Subject: [PATCH] fixed: duplicated comics not being added --- YACReaderLibrary/library_creator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/YACReaderLibrary/library_creator.cpp b/YACReaderLibrary/library_creator.cpp index 22dff09c..cb3d19bf 100644 --- a/YACReaderLibrary/library_creator.cpp +++ b/YACReaderLibrary/library_creator.cpp @@ -228,8 +228,8 @@ void LibraryCreator::insertComic(const QString & relativePath,const QFileInfo & QString hash = QString(crypto.result().toHex().constData()) + QString::number(fileInfo.size()); ComicDB comic = DBHelper::loadComic(fileInfo.fileName(),relativePath,hash,_database); int numPages = 0; - - if(! ( comic.hasCover() && checkCover(hash))) + bool exists = checkCover(hash); + if(! ( comic.hasCover() && exists)) { ThumbnailCreator tc(QDir::cleanPath(fileInfo.absoluteFilePath()),_target+"/covers/"+hash+".jpg",comic.info.coverPage.toInt()); tc.create(); @@ -238,7 +238,7 @@ void LibraryCreator::insertComic(const QString & relativePath,const QFileInfo & emit(comicAdded(relativePath,_target+"/covers/"+hash+".jpg")); } - if (numPages > 0) + if (numPages > 0 || exists) { //en este punto sabemos que todos los folders que hay en _currentPath, deberían estar añadidos a la base de datos insertFolders();