Skip to content

Commit

Permalink
espn content is also removed when the user just closes the window
Browse files Browse the repository at this point in the history
  • Loading branch information
JorickPepin committed Dec 24, 2020
1 parent 65590bf commit d182929
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/recordsnbawiki/packLogic/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ public void removeESPNContent() {
truncateIndex = content.lastIndexOf('\n', truncateIndex - 1);
}

content = content.substring(0, truncateIndex);
content = content.substring(0, truncateIndex); // remove the 3 last lines

content = content.replaceAll("\\{\\{,\\}\\}<ref>.*<\\/ref>", "");
content = content.replaceAll("\\{\\{,\\}\\}<ref>.*<\\/ref>", ""); // remove the ESPN ref
}

public String getRealGMPlayerName() {
Expand Down
2 changes: 1 addition & 1 deletion src/recordsnbawiki/packLogic/ESPN.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private String[] recuperationContenu() throws ESPNException {

// récupération du titre de la page
titre = document.title();

// le nombre de double-double en saison régulière correspond au 36e élément <span class="fw-bold">
DD2_SR = document.select("span.fw-bold").get(36).text();
// le nombre de triple-double en saison régulière correspond au 37e élément <span class="fw-bold">
Expand Down
2 changes: 1 addition & 1 deletion src/recordsnbawiki/packVue/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void displayESPNWarningMessage() {

int answer = JOptionPane.showOptionDialog(this, message, "Avertissement contenu ESPN", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[1]);

if (answer == 1) { // the user clicks on OK
if (answer == 1 || answer == -1) { // the user clicks on OK or close the window
controller.removeESPNContent();
}
}
Expand Down

0 comments on commit d182929

Please sign in to comment.