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
@ -193,9 +193,9 @@ QList<ComicDB> DBHelper::getLabelComics(qulonglong libraryId, qulonglong labelId
|
||||
}
|
||||
|
||||
db.close();
|
||||
}
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
}
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -237,8 +237,8 @@ QList<ComicDB> DBHelper::getFavorites(qulonglong libraryId)
|
||||
|
||||
db.close();
|
||||
}
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -277,8 +277,8 @@ QList<ComicDB> DBHelper::getReading(qulonglong libraryId)
|
||||
|
||||
db.close();
|
||||
}
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -316,9 +316,9 @@ QList<ReadingList> DBHelper::getReadingLists(qulonglong libraryId)
|
||||
list.insert(i,item);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -371,10 +371,10 @@ QList<ComicDB> DBHelper::getReadingListFullContent(qulonglong libraryId, qulongl
|
||||
list.append(comic);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
//TODO ?
|
||||
//QSqlDatabase::removeDatabase(db.connectionName());
|
||||
|
||||
return list;
|
||||
}
|
||||
@ -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);
|
||||
@ -952,8 +967,8 @@ void DBHelper::insertComicsInFavorites(const QList<ComicDB> &comicsList, QSqlDat
|
||||
query.bindValue(":ordering", numComics++);
|
||||
query.exec();
|
||||
}
|
||||
|
||||
QLOG_TRACE() << query.lastError();
|
||||
|
||||
QLOG_TRACE() << query.lastError();
|
||||
|
||||
db.commit();
|
||||
}
|
||||
@ -978,8 +993,8 @@ void DBHelper::insertComicsInLabel(const QList<ComicDB> &comicsList, qulonglong
|
||||
query.bindValue(":ordering", numComics++);
|
||||
query.exec();
|
||||
}
|
||||
|
||||
QLOG_TRACE() << query.lastError();
|
||||
|
||||
QLOG_TRACE() << query.lastError();
|
||||
|
||||
db.commit();
|
||||
}
|
||||
|
@ -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