mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add method for marking a comic as reading without opening it first.
Usefull when closing the a comic in the last page to mark the next one and the next being readed.
This commit is contained in:
parent
45e44fa54f
commit
1503fe5383
@ -704,6 +704,21 @@ void DBHelper::updateProgress(qulonglong libraryId, const ComicInfo &comicInfo)
|
||||
QSqlDatabase::removeDatabase(db.connectionName());
|
||||
}
|
||||
|
||||
void DBHelper::setComicAsReading(qulonglong libraryId, const ComicInfo &comicInfo)
|
||||
{
|
||||
QString libraryPath = DBHelper::getLibraries().getPath(libraryId);
|
||||
QSqlDatabase db = DataBaseManagement::loadDatabase(libraryPath+"/.yacreaderlibrary");
|
||||
|
||||
ComicDB comic = DBHelper::loadComic(comicInfo.id,db);
|
||||
comic.info.hasBeenOpened = true;
|
||||
comic.info.read = comic.info.read || comic.info.currentPage == comic.info.numPages;
|
||||
|
||||
DBHelper::updateReadingRemoteProgress(comic.info,db);
|
||||
|
||||
db.close();
|
||||
QSqlDatabase::removeDatabase(db.connectionName());
|
||||
}
|
||||
|
||||
void DBHelper::updateReadingRemoteProgress(const ComicInfo &comicInfo, QSqlDatabase &db)
|
||||
{
|
||||
QSqlQuery updateComicInfo(db);
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
static void updateChildrenInfo(qulonglong folderId, QSqlDatabase & db);
|
||||
static void updateChildrenInfo(QSqlDatabase & db);
|
||||
static void updateProgress(qulonglong libraryId,const ComicInfo & comicInfo);
|
||||
static void setComicAsReading(qulonglong libraryId, const ComicInfo &comicInfo);
|
||||
static void updateReadingRemoteProgress(const ComicInfo & comicInfo, QSqlDatabase & db);
|
||||
static void updateFromRemoteClient(qulonglong libraryId,const ComicInfo & comicInfo);
|
||||
static void renameLabel(qulonglong id, const QString & name, QSqlDatabase & db);
|
||||
|
Loading…
Reference in New Issue
Block a user