diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2016-01-22 17:12:40 -0500 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2016-01-22 17:12:40 -0500 |
commit | e93f161b764e44d95699abcdecd9c8cf00de94f7 (patch) | |
tree | b73aa1a4002ee6881d191568fdfda44a24aaaf14 /core/src | |
parent | bb78f0805aaa35e77e5b9dc3d4b723aeae82be74 (diff) | |
parent | a578c59dcca78c7a7c3d2b9666d8637e78fd9826 (diff) | |
download | AntennaPod-e93f161b764e44d95699abcdecd9c8cf00de94f7.zip |
Merge pull request #1579 from mfietz/issue/998-itunes-tags
Parse <itunes:summary> and <itunes:subtitle>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java | 23 |
1 files changed, 20 insertions, 3 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 9b9849c49..99c4cd67a 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 @@ -19,6 +19,8 @@ public class NSITunes extends Namespace { private static final String AUTHOR = "author"; public static final String DURATION = "duration"; + public static final String SUBTITLE = "subtitle"; + public static final String SUMMARY = "summary"; @Override @@ -67,13 +69,28 @@ public class NSITunes extends Namespace { } else { return; } - state.getTempObjects().put(DURATION, duration); } catch (NumberFormatException e) { e.printStackTrace(); } + } else if (localName.equals(SUBTITLE)) { + String subtitle = state.getContentBuf().toString(); + if (state.getCurrentItem() != null) { + if (TextUtils.isEmpty(state.getCurrentItem().getDescription())) { + state.getCurrentItem().setDescription(subtitle); + } + } else { + if (TextUtils.isEmpty(state.getFeed().getDescription())) { + state.getFeed().setDescription(subtitle); + } + } + } else if (localName.equals(SUMMARY)) { + String summary = state.getContentBuf().toString(); + if (state.getCurrentItem() != null) { + state.getCurrentItem().setDescription(summary); + } else { + state.getFeed().setDescription(summary); + } } - } - } |