workaround for foreign card arts getting priority by default (#3652)

fixes #3623
This commit is contained in:
ebbit1q 2019-03-12 10:12:31 +01:00 committed by ctrlaltca
parent 2d8f01b2e9
commit 7eb2e36740
3 changed files with 17 additions and 3 deletions

View file

@ -2,6 +2,7 @@
#define MAIN_H
class QTranslator;
class QString;
extern QTranslator *translator;
extern const QString translationPrefix;

View file

@ -46,16 +46,22 @@ bool OracleImporter::readSetsFromByteArray(const QByteArray &data)
setCards = map.value("cards").toList();
setType = map.value("type").toString();
// capitalize set type
if (setType.length() > 0)
if (setType.length() > 0) {
setType[0] = setType[0].toUpper();
}
if (!nonEnglishSets.contains(shortName)) {
releaseDate = map.value("releaseDate").toDate();
} else {
releaseDate = QDate();
}
newSetList.append(SetToDownload(shortName, longName, setCards, setType, releaseDate));
}
qSort(newSetList);
if (newSetList.isEmpty())
if (newSetList.isEmpty()) {
return false;
}
allSets = newSetList;
return true;
}

View file

@ -6,6 +6,13 @@
#include <carddatabase.h>
#include <utility>
// many users prefer not to see these sets with non english arts
// as a solution we remove the date property on these sets
// that way they will be sorted last by default
// this will cause their art to not get priority over english cards
// users will still be able to find these sets and prioritize them manually
const QStringList nonEnglishSets = {"FBB", "PS11", "PSAL", "REN"};
class SetToDownload
{
private: