Skip to content

Commit

Permalink
source clean
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Dec 2, 2024
1 parent a8353fe commit a83925a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ public String[] listFilter() {
public MTGDeck getDeck(RetrievableDeck info) throws IOException {
//

MTGDeck deck = info.toBaseDeck();
var deck = info.toBaseDeck();

logger.debug("get deck {}",info.getUrl());
Document d = URLTools.extractAsHtml(info.getUrl().toString());
var d = URLTools.extractAsHtml(info.getUrl().toString());

if (d.select("div#deck_overview_info") != null)
deck.setDescription(d.select("div#deck_overview_info").select("div.deck_text_editable_container").text());
Expand All @@ -120,10 +120,10 @@ public MTGDeck getDeck(RetrievableDeck info) throws IOException {
for (Element a : d.select("a.deck_tags_list_tag"))
deck.getTags().add(a.text());

Elements e = d.select("textarea#deck_code");
String content= e.html();
var e = d.select("textarea#deck_code");
var content= e.html();

String[] arr = content.split("\n");
var arr = content.split("\n");

arr = ArrayUtils.remove(arr, 0); //remove deck name
arr = ArrayUtils.remove(arr, 0); //remove //main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ public List<RetrievableDeck> getDeckList(String filter, MTGCard mc) throws IOExc

String url = baseUrl + "/magic/deck/search?format=" + filter;
logger.debug("get List deck at {}",url);
List<RetrievableDeck> list = new ArrayList<>();
int maxPage = getInt(MAX_PAGE);
var list = new ArrayList<RetrievableDeck>();

for (var i = 1; i <= maxPage; i++) {
for (var i = 1; i <= getInt(MAX_PAGE); i++) {
url = baseUrl + "/magic/deck/search?format=" + filter + "&page=" + i;
Document d = URLTools.extractAsHtml(url);

Expand Down

0 comments on commit a83925a

Please sign in to comment.