summaryrefslogtreecommitdiff
path: root/core/src/main/java/de/danoeh
diff options
context:
space:
mode:
authorMartin Olsson <martin@minimum.se>2014-12-02 23:51:36 +0100
committerMartin Olsson <martin@minimum.se>2014-12-06 16:00:11 +0100
commit4dd97c6ccaa681b007c5556575eb7fff709caa59 (patch)
tree5d4ae434dc2408f6955791299d0a2f473840b3f8 /core/src/main/java/de/danoeh
parent1173b6704944222b23097ab7020b0417d5ce094a (diff)
downloadAntennaPod-4dd97c6ccaa681b007c5556575eb7fff709caa59.zip
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 <itunes:duration>14:57 </itunes:duration> 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.
Diffstat (limited to 'core/src/main/java/de/danoeh')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java2
1 files changed, 1 insertions, 1 deletions
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) {