mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
Oracle: fetch release date and set type
and save them in cards.xml
This commit is contained in:
parent
a320af70da
commit
cb37073828
4 changed files with 31 additions and 11 deletions
|
|
@ -30,6 +30,8 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
|
|||
QString edition;
|
||||
QString editionLong;
|
||||
QVariant editionCards;
|
||||
QString setType;
|
||||
QDate releaseDate;
|
||||
bool import;
|
||||
|
||||
while (it.hasNext()) {
|
||||
|
|
@ -37,12 +39,14 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
|
|||
edition = map.value("code").toString();
|
||||
editionLong = map.value("name").toString();
|
||||
editionCards = map.value("cards");
|
||||
setType = map.value("type").toString();
|
||||
releaseDate = map.value("releaseDate").toDate();
|
||||
|
||||
// core and expansion sets are marked to be imported by default
|
||||
import = (0 == QString::compare(map.value("type").toString(), QString("core"), Qt::CaseInsensitive) ||
|
||||
0 == QString::compare(map.value("type").toString(), QString("expansion"), Qt::CaseInsensitive));
|
||||
import = (0 == QString::compare(setType, QString("core"), Qt::CaseInsensitive) ||
|
||||
0 == QString::compare(setType, QString("expansion"), Qt::CaseInsensitive));
|
||||
|
||||
newSetList.append(SetToDownload(edition, editionLong, editionCards, import));
|
||||
newSetList.append(SetToDownload(edition, editionLong, editionCards, import, setType, releaseDate));
|
||||
}
|
||||
|
||||
qSort(newSetList);
|
||||
|
|
@ -237,7 +241,7 @@ int OracleImporter::startImport()
|
|||
if(!curSet->getImport())
|
||||
continue;
|
||||
|
||||
CardSet *set = new CardSet(curSet->getShortName(), curSet->getLongName());
|
||||
CardSet *set = new CardSet(curSet->getShortName(), curSet->getLongName(), curSet->getSetType(), curSet->getReleaseDate());
|
||||
if (!sets.contains(set->getShortName()))
|
||||
sets.insert(set->getShortName(), set);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue