Offer distance parse 0.0 as int FIX

This commit is contained in:
Patrick Haßel 2024-06-18 10:53:41 +02:00
parent f9e67f0531
commit e3a64c70b9

View File

@ -71,7 +71,7 @@ public class OfferCreate {
} }
zipcode = locationMatcher.group("zipcode"); zipcode = locationMatcher.group("zipcode");
location = locationMatcher.group("location"); location = locationMatcher.group("location");
distance = Integer.parseInt(locationMatcher.group("distance")); distance = (int) Math.round(Double.parseDouble(locationMatcher.group("distance")));
imageURL = getImageURL(articleURL); imageURL = getImageURL(articleURL);
final Matcher priceMatcher = Pattern.compile("(?<price>\\d+(?:[,.]\\d+)?) €(?<negotiable> VB)?").matcher(article.select(".aditem-main--middle--price-shipping--price").text()); final Matcher priceMatcher = Pattern.compile("(?<price>\\d+(?:[,.]\\d+)?) €(?<negotiable> VB)?").matcher(article.select(".aditem-main--middle--price-shipping--price").text());