Support MTGJSONv5 format in Oracle downloader (#4162)

* Fix #4043, Support MTGJSONv5 format in Oracle downloader

* Auto redirect V4 downloads to V5, as we won't support V4 after this change

* clangify >_>

* Remove null values and account for IDs missing

* fix split cards and double faced cards somewhat

* do not consider double faced cards duplicates

* fix promo double sided cards

* typo

* fix alternative versions of cards with (letter)

* zach says this is more readable

* pre qt 5.10 compatibility

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
Zach H 2020-11-23 16:12:41 -05:00 committed by GitHub
parent f3cf1f0dde
commit 9f9581c2be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 118 additions and 76 deletions

View file

@ -60,10 +60,10 @@ public:
class SplitCardPart
{
public:
SplitCardPart(int _index, const QString &_text, const QVariantHash &_properties, CardInfoPerSet setInfo);
inline const int &getIndex() const
SplitCardPart(const QString &_name, const QString &_text, const QVariantHash &_properties, CardInfoPerSet setInfo);
inline const QString &getName() const
{
return index;
return name;
}
inline const QString &getText() const
{
@ -79,7 +79,7 @@ public:
}
private:
int index;
QString name;
QString text;
QVariantHash properties;
CardInfoPerSet setInfo;
@ -111,7 +111,7 @@ public:
bool readSetsFromByteArray(const QByteArray &data);
int startImport();
bool saveToFile(const QString &fileName, const QString &sourceUrl, const QString &sourceVersion);
int importCardsFromSet(CardSetPtr currentSet, const QList<QVariant> &cards, bool skipSpecialNums = true);
int importCardsFromSet(const CardSetPtr &currentSet, const QList<QVariant> &cards, bool skipSpecialNums = true);
QList<SetToDownload> &getSets()
{
return allSets;
@ -123,7 +123,7 @@ public:
void clear();
protected:
inline QString getStringPropertyFromMap(QVariantMap card, QString propertyName);
inline QString getStringPropertyFromMap(const QVariantMap &card, const QString &propertyName);
void sortAndReduceColors(QString &colors);
};