mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-28 20:00:24 -07:00
[Card Database] Improve loading times through binary cache (#7051)
* [Card Database] Improve loading times through binary cache Took 10 minutes Took 9 minutes Took 16 seconds * [Card Database] Remove lib qt include Took 18 minutes Took 14 seconds * Downgrade to 6.3 datastream Took 5 minutes * go up to 6.4 datastream Took 1 minute * Address comments * Small bug fixes Took 20 minutes Took 10 seconds * More fixes. Took 4 minutes Took 4 seconds * Even more fixes. Took 11 minutes Took 4 seconds * More fixes. Took 6 minutes Took 26 seconds Took 8 minutes * Namespace instead of class Took 6 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
4bb8831531
commit
749223c2dc
31 changed files with 1604 additions and 106 deletions
|
|
@ -291,12 +291,13 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
|
||||
// per-set properties
|
||||
PrintingInfo printingInfo = PrintingInfo(currentSet);
|
||||
QVariantHash printingProps;
|
||||
for (auto i = setInfoProperties.cbegin(), end = setInfoProperties.cend(); i != end; ++i) {
|
||||
QString mtgjsonProperty = i.key();
|
||||
QString xmlPropertyName = i.value();
|
||||
QString propertyValue = getStringPropertyFromMap(card, mtgjsonProperty);
|
||||
if (!propertyValue.isEmpty()) {
|
||||
printingInfo.setProperty(xmlPropertyName, propertyValue);
|
||||
printingProps.insert(xmlPropertyName, propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -304,7 +305,7 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
QString faceFlavorName = getStringPropertyFromMap(card, "faceFlavorName");
|
||||
QString flavorName = !faceFlavorName.isEmpty() ? faceFlavorName : getStringPropertyFromMap(card, "flavorName");
|
||||
if (!flavorName.isEmpty()) {
|
||||
printingInfo.setProperty("flavorName", flavorName);
|
||||
printingProps.insert("flavorName", flavorName);
|
||||
}
|
||||
|
||||
// Identifiers
|
||||
|
|
@ -313,10 +314,12 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
|||
QString xmlPropertyName = i.value();
|
||||
QString propertyValue = getStringPropertyFromMap(card.value("identifiers").toMap(), mtgjsonProperty);
|
||||
if (!propertyValue.isEmpty()) {
|
||||
printingInfo.setProperty(xmlPropertyName, propertyValue);
|
||||
printingProps.insert(xmlPropertyName, propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
printingInfo.setProperties(printingProps);
|
||||
|
||||
QString numComponent;
|
||||
const QString numProperty = printingInfo.getProperty("num");
|
||||
const QChar lastChar = numProperty.isEmpty() ? QChar() : numProperty.back();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue