diff --git a/YACReaderLibrary/db/tablemodel.cpp b/YACReaderLibrary/db/tablemodel.cpp index 7898f3d4..52092ce8 100644 --- a/YACReaderLibrary/db/tablemodel.cpp +++ b/YACReaderLibrary/db/tablemodel.cpp @@ -569,6 +569,7 @@ void TableModel::reload(const ComicDB & comic) if(item->data(TableModel::Id).toULongLong() == comic.id) { found = true; + item->setData(TableModel::ReadColumn,comic.info.read); item->setData(TableModel::CurrentPage,comic.info.currentPage); item->setData(TableModel::HasBeenOpened,true); break; diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index a0e71200..b35e9612 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -252,7 +252,8 @@ void DBHelper::update(ComicInfo * comicInfo, QSqlDatabase & db) updateComicInfo.bindValue(":characters",comicInfo->characters); updateComicInfo.bindValue(":notes",comicInfo->notes); - updateComicInfo.bindValue(":read", comicInfo->read?1:0); + bool read = comicInfo->read || comicInfo->currentPage == comicInfo->numPages.toInt(); //if current page is the las page, the comic is read(completed) + updateComicInfo.bindValue(":read", read?1:0); updateComicInfo.bindValue(":id", comicInfo->id); updateComicInfo.bindValue(":edited", comicInfo->edited?1:0);