| 103 | } |
| 104 | |
| 105 | void XMLInfoLibraryScanner::updateFromSQLQuery(QSqlDatabase &db, QSqlQuery &query) |
| 106 | { |
| 107 | QSqlRecord record = query.record(); |
| 108 | |
| 109 | int id = record.indexOf("id"); |
| 110 | // int parentIdIndex = record.indexOf("parentId"); |
| 111 | int fileNameIndex = record.indexOf("fileName"); |
| 112 | int pathIndex = record.indexOf("path"); |
| 113 | |
| 114 | while (query.next()) { |
| 115 | if (this->stopRunning) { |
| 116 | break; |
| 117 | } |
| 118 | auto fileName = query.value(fileNameIndex).toString(); |
| 119 | auto path = query.value(pathIndex).toString(); |
| 120 | |
| 121 | emit comicScanned(path, fileName); |
| 122 | |
| 123 | auto info = DBHelper::getComicInfoFromQuery(query, "comicInfoId"); |
| 124 | |
| 125 | InitialComicInfoExtractor ie(QDir::cleanPath(this->source + path), "None", info.coverPage.toInt(), true); |
| 126 | |
| 127 | ie.extract(); |
| 128 | |
| 129 | if (parseXMLIntoInfo(ie.getXMLInfoRawData(), info)) { |
| 130 | DBHelper::update(&info, db); |
| 131 | } |
| 132 | } |
| 133 | } |
nothing calls this directly
no test coverage detected