mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 02:53:56 -07:00
Remove deck brew by ZeldaZach
This commit is contained in:
parent
8ce5c5a276
commit
839da83d2c
7 changed files with 46 additions and 25 deletions
|
|
@ -35,14 +35,19 @@ AbstractPriceUpdater::AbstractPriceUpdater(const DeckList *_deck)
|
|||
*
|
||||
* @param _deck deck.
|
||||
*/
|
||||
|
||||
/*
|
||||
DBPriceUpdater::DBPriceUpdater(const DeckList *_deck)
|
||||
: AbstractPriceUpdater(_deck)
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Update the prices of the cards in deckList.
|
||||
*/
|
||||
|
||||
/*
|
||||
void DBPriceUpdater::updatePrices()
|
||||
{
|
||||
QString base = "https://api.deckbrew.com/mtg/cards", q = "";
|
||||
|
|
@ -88,7 +93,9 @@ void DBPriceUpdater::updatePrices()
|
|||
|
||||
requestNext();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
void DBPriceUpdater::requestNext()
|
||||
{
|
||||
if(urls.empty())
|
||||
|
|
@ -99,10 +106,12 @@ void DBPriceUpdater::requestNext()
|
|||
QNetworkReply *reply = nam->get(QNetworkRequest(url));
|
||||
connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished()));
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Called when the download of the json file with the prices is finished.
|
||||
*/
|
||||
/*
|
||||
void DBPriceUpdater::downloadFinished()
|
||||
{
|
||||
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
|
||||
|
|
@ -180,11 +189,11 @@ void DBPriceUpdater::downloadFinished()
|
|||
float price = edition.value("price").toMap().value("median").toString().toFloat() / 100;
|
||||
//qDebug() << "card " << name << " set " << set << " price " << price << endl;
|
||||
|
||||
/**
|
||||
|
||||
* Make sure Masters Edition (MED) isn't the set, as it doesn't
|
||||
* physically exist. Also check the price to see that the cheapest set
|
||||
* ends up as the final price.
|
||||
*/
|
||||
|
||||
if (set != "MED" && price > 0 && (!cardsPrice.contains(name) || cardsPrice.value(name) > price))
|
||||
cardsPrice.insert(name, price);
|
||||
}
|
||||
|
|
@ -212,3 +221,4 @@ void DBPriceUpdater::downloadFinished()
|
|||
requestNext();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue