diff options
Diffstat (limited to 'main/src/cgeo/geocaching/connector/gc/GCParser.java')
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCParser.java | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java index 26aa7ad..f7dc684 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCParser.java +++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java @@ -522,35 +522,32 @@ public abstract class GCParser { // cache spoilers try { - final String spoilers = BaseUtils.getMatch(page, GCConstants.PATTERN_SPOILERS, false, null); - if (null != spoilers) { - if (CancellableHandler.isCancelled(handler)) { - return null; - } - CancellableHandler.sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_spoilers); + if (CancellableHandler.isCancelled(handler)) { + return null; + } + CancellableHandler.sendLoadProgressDetail(handler, R.string.cache_dialog_loading_details_status_spoilers); - final Matcher matcherSpoilersInside = GCConstants.PATTERN_SPOILERSINSIDE.matcher(spoilers); + final Matcher matcherSpoilersInside = GCConstants.PATTERN_SPOILER_IMAGE.matcher(page); - while (matcherSpoilersInside.find()) { - // the original spoiler URL (include .../display/... contains a low-resolution image - // if we shorten the URL we get the original-resolution image - String url = matcherSpoilersInside.group(1).replace("/display", ""); + while (matcherSpoilersInside.find()) { + // the original spoiler URL (include .../display/... contains a low-resolution image + // if we shorten the URL we get the original-resolution image + String url = matcherSpoilersInside.group(1).replace("/display", ""); - String title = null; - if (matcherSpoilersInside.group(2) != null) { - title = matcherSpoilersInside.group(2); - } - String description = null; - if (matcherSpoilersInside.group(3) != null) { - description = matcherSpoilersInside.group(3); - } - final cgImage spoiler = new cgImage(url, title, description); + String title = null; + if (matcherSpoilersInside.group(2) != null) { + title = matcherSpoilersInside.group(2); + } + String description = null; + if (matcherSpoilersInside.group(3) != null) { + description = matcherSpoilersInside.group(3); + } + final cgImage spoiler = new cgImage(url, title, description); - if (cache.getSpoilers() == null) { - cache.setSpoilers(new ArrayList<cgImage>()); - } - cache.getSpoilers().add(spoiler); + if (cache.getSpoilers() == null) { + cache.setSpoilers(new ArrayList<cgImage>()); } + cache.getSpoilers().add(spoiler); } } catch (Exception e) { // failed to parse cache spoilers |
