MCPcopy Create free account
hub / github.com/YACReader/yacreader / updateFromSQLQuery

Method updateFromSQLQuery

YACReaderLibrary/xml_info_library_scanner.cpp:105–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void 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}

Callers

nothing calls this directly

Calls 4

toStringMethod · 0.80
extractMethod · 0.80
getXMLInfoRawDataMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected