diff options
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java | 9 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java | 7 |
2 files changed, 8 insertions, 8 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 e5f53d8ea..1c424c6b5 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 @@ -61,11 +61,11 @@ public class NSITunes extends Namespace { state.getFeed().setAuthor(author); } } else if (DURATION.equals(localName)) { - String duration = state.getContentBuf().toString(); - if(TextUtils.isEmpty(duration)) { + String durationStr = state.getContentBuf().toString(); + if(TextUtils.isEmpty(durationStr)) { return; } - String[] parts = duration.trim().split(":"); + String[] parts = durationStr.trim().split(":"); try { int durationMs = 0; if (parts.length == 2) { @@ -80,8 +80,7 @@ public class NSITunes extends Namespace { } state.getTempObjects().put(DURATION, durationMs); } catch (NumberFormatException e) { - Log.e(NSTAG, "duration: " + duration); - Log.e(NSTAG, Log.getStackTraceString(e)); + Log.e(NSTAG, "Duration \"" + durationStr + "\" could not be parsed"); } } else if (SUBTITLE.equals(localName)) { String subtitle = state.getContentBuf().toString(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java index 39f553818..7a8b2bc03 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java @@ -40,10 +40,11 @@ public class NSMedia extends Namespace { if (state.getCurrentItem() != null && state.getCurrentItem().getMedia() == null && url != null && validType) { long size = 0; + String sizeStr = attributes.getValue(SIZE); try { - size = Long.parseLong(attributes.getValue(SIZE)); + size = Long.parseLong(sizeStr); } catch (NumberFormatException e) { - Log.e(TAG, "Length attribute could not be parsed."); + Log.e(TAG, "Size \"" + sizeStr + "\" could not be parsed."); } int durationMs = 0; @@ -53,7 +54,7 @@ public class NSMedia extends Namespace { long duration = Long.parseLong(durationStr); durationMs = (int) TimeUnit.MILLISECONDS.convert(duration, TimeUnit.SECONDS); } catch (NumberFormatException e) { - Log.e(TAG, "Duration attribute could not be parsed"); + Log.e(TAG, "Duration \"" + durationStr + "\" could not be parsed"); } } FeedMedia media = new FeedMedia(state.getCurrentItem(), url, size, type); |