Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
bugfix issues/14
  • Loading branch information
nicho92 committed Dec 21, 2017
1 parent fb7e1da commit ebd7809
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
<unix>.sh</unix>
</binFileExtensions>
<extraJvmArguments>-Xmx1128m</extraJvmArguments>
<showConsoleWindow>true</showConsoleWindow>
<showConsoleWindow>false</showConsoleWindow>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/magic/api/dao/impl/PostgresqlDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ public void saveOrUpdateStock(MagicCardStock state) throws SQLException {
pst.setString(5, state.getLanguage());
pst.setInt(6, state.getQte());
pst.setString(7, state.getComment());
pst.setString(8, state.getMagicCard().getId());
pst.setString(8, IDGenerator.generate(state.getMagicCard()));
pst.setString(9, state.getMagicCollection().getName());
pst.setBoolean(10, state.isAltered());
pst.setDouble(11, state.getPrice());
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/org/magic/api/pricers/impl/CardKingdomPricer.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
import org.magic.api.beans.MagicPrice;
import org.magic.api.interfaces.MagicCardsProvider.STATUT;
import org.magic.api.interfaces.abstracts.AbstractMagicPricesProvider;
import org.magic.services.MTGConstants;
import org.magic.services.MTGControler;
import org.magic.tools.InstallCert;

public class CardKingdomPricer extends AbstractMagicPricesProvider {

Expand All @@ -43,11 +46,17 @@ public CardKingdomPricer() {

if(!new File(confdir, getName()+".conf").exists()){
props.put("URL", "https://www.cardkingdom.com/mtg/");
props.put("WEBSITE", "http://www.cardkingdom.com/");
props.put("WEBSITE", "https://www.cardkingdom.com/");
props.put("USER_AGENT", "Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
save();
}

try {
InstallCert.install("www.cardkingdom.com");
System.setProperty("javax.net.ssl.trustStore",new File(MTGControler.CONF_DIR,MTGConstants.KEYSTORE_NAME).getAbsolutePath());
} catch (Exception e1) {
logger.error(e1);
}

eds=new ArrayList<String>();
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/magic/gui/LaunchWindows.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void stop() {

@Override
public void update(Observable o, Object msg) {
progressBar.setString(msg.toString());
progressBar.setString(String.valueOf(msg));

}

Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/magic/services/MTGAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ public boolean requiresLayout() {
protected void append(LoggingEvent event) {
events.add(event);
obs.setChanged();
obs.notifyObservers(event.getMessage());
try{
obs.notifyObservers(event.getMessage());
}catch(Exception e)
{
e.printStackTrace();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/magic/services/MTGControler.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private MTGControler()
.setFile(new File(CONF_DIR,"mtgcompanion-conf.xml"))
.setSchemaValidation(false)
.setValidating(false)
.setEncoding("ISO-8859-15")
.setEncoding("UTF-8")
.setExpressionEngine(new XPathExpressionEngine())
);

Expand Down

0 comments on commit ebd7809

Please sign in to comment.