From 4dd97c6ccaa681b007c5556575eb7fff709caa59 Mon Sep 17 00:00:00 2001 From: Martin Olsson Date: Tue, 2 Dec 2014 23:51:36 +0100 Subject: [PATCH] Parse podcast duration correctly even with trailing whitespace The Skeptoid podcast (available on gpodder.net) currently has a specific episode (titled "Skeptoid #437: Tube Amplifiers") that contains the XML 14:57 which AntennaPod fails to parse (and instead hits a java.lang.NumberFormatException which it prints to stderr every time the refresh button is pressed). The duration for that particular episode is not correctly showed in the UI, although the duration for other Skeptoid episodes show up just fine. --- .../danoeh/antennapod/core/syndication/namespace/NSITunes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java index 70e1126b9..ff9828eba 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java @@ -50,7 +50,7 @@ public class NSITunes extends Namespace { if (localName.equals(AUTHOR)) { state.getFeed().setAuthor(state.getContentBuf().toString()); } else if (localName.equals(DURATION)) { - String[] parts = state.getContentBuf().toString().split(":"); + String[] parts = state.getContentBuf().toString().trim().split(":"); try { int duration = 0; if (parts.length == 2) {