Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Dec 15, 2024
1 parent a6f603f commit b8097ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ public List<RetrievableDeck> getDeckList(String filter, MTGCard mc) throws IOExc
if (metagames)
maxPage = 1;

var baseUrl="https://www.mtggoldfish.com/";
for (var i = 1; i <= maxPage; i++) {

var baseUrl="https://www.mtggoldfish.com/";

if (!metagames)
url = baseUrl + "/deck/custom/" + filter + "?page=" + nbPage + "#"+ getString(SUPPORT);
else
Expand Down Expand Up @@ -157,7 +156,7 @@ public List<RetrievableDeck> getDeckList(String filter, MTGCard mc) throws IOExc
deck.setUrl(new URI(baseUrl + desc.get(0).attr("href")));

if (metagames)
deck.setAuthor("MtgGoldFish");
deck.setAuthor(getName());
else
deck.setAuthor(cont.select("div.deck-tile-author").text());

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/magic/gui/models/CardStockTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public Class<?> getColumnClass(int columnIndex) {
return Boolean.class;
case 13:
return Boolean.class;

case 14:
return MoneyValue.class;
case 15:
Expand Down Expand Up @@ -197,7 +196,10 @@ public void setValueAt(Object aValue, int row, int column) {
items.get(row).setAltered(Boolean.parseBoolean(aValue.toString()));
break;
case 13:
items.get(row).setDigital(Boolean.parseBoolean(aValue.toString()));
if(items.get(row).getProduct().isOnlineOnly())
items.get(row).setDigital(true);
else
items.get(row).setDigital(Boolean.parseBoolean(aValue.toString()));
break;
case 14:
items.get(row).setPrice(UITools.parseDouble(String.valueOf(aValue)));
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/magic/services/CollectionEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.Map;
import java.util.TreeMap;

import org.apache.logging.log4j.core.Logger;
import org.magic.api.beans.CardShake;
import org.magic.api.beans.EditionsShakers;
import org.magic.api.beans.MTGCard;
Expand All @@ -23,6 +24,7 @@
import org.magic.api.interfaces.MTGCardsProvider;
import org.magic.api.interfaces.MTGDao;
import org.magic.api.interfaces.MTGDashBoard;
import org.magic.services.logging.MTGLogger;
import org.magic.services.tools.FileTools;
import org.utils.patterns.observer.Observable;

Expand All @@ -38,7 +40,7 @@ public class CollectionEvaluator extends Observable
private JsonExport serialiser;
private Map<MTGEdition,Map<MTGCard,CardShake>> cache;
private int minPrice=0;

private static Logger logger = MTGLogger.getLogger(CollectionEvaluator.class);
public File getDirectory() {
return directory;
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/utils/patterns/observer/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.logging.log4j.Logger;
import org.magic.services.logging.MTGLogger;

public class Observable {
private boolean changed = false;
private List<Observer> obs;
protected static Logger logger = MTGLogger.getLogger(Observable.class);

public Observable() {
obs = new ArrayList<>();
Expand Down

0 comments on commit b8097ef

Please sign in to comment.