| 1071 | } |
| 1072 | |
| 1073 | void DBHelper::updateReadingRemoteProgress(const ComicInfo &comicInfo, QSqlDatabase &db) |
| 1074 | { |
| 1075 | QSqlQuery updateComicInfo(db); |
| 1076 | updateComicInfo.prepare("UPDATE comic_info SET " |
| 1077 | "read = :read, " |
| 1078 | "currentPage = :currentPage, " |
| 1079 | "hasBeenOpened = :hasBeenOpened, " |
| 1080 | "lastTimeOpened = :lastTimeOpened, " |
| 1081 | "rating = :rating" |
| 1082 | " WHERE id = :id "); |
| 1083 | |
| 1084 | updateComicInfo.bindValue(":read", comicInfo.read ? 1 : 0); |
| 1085 | updateComicInfo.bindValue(":currentPage", comicInfo.currentPage); |
| 1086 | updateComicInfo.bindValue(":hasBeenOpened", comicInfo.hasBeenOpened ? 1 : 0); |
| 1087 | updateComicInfo.bindValue(":lastTimeOpened", QDateTime::currentSecsSinceEpoch()); |
| 1088 | updateComicInfo.bindValue(":id", comicInfo.id); |
| 1089 | updateComicInfo.bindValue(":rating", comicInfo.rating); |
| 1090 | updateComicInfo.exec(); |
| 1091 | |
| 1092 | updateComicInfo.clear(); |
| 1093 | } |
| 1094 | |
| 1095 | // server v1 |
| 1096 | void DBHelper::updateFromRemoteClient(qulonglong libraryId, const ComicInfo &comicInfo) |