Merge pull request #1579 from mfietz/issue/998-itunes-tags

Parse <itunes:summary> and <itunes:subtitle>
This commit is contained in:
Tom Hennen 2016-01-22 17:12:40 -05:00
commit e93f161b76
1 changed files with 20 additions and 3 deletions

View File

@ -19,6 +19,8 @@ public class NSITunes extends Namespace {
private static final String AUTHOR = "author"; private static final String AUTHOR = "author";
public static final String DURATION = "duration"; public static final String DURATION = "duration";
public static final String SUBTITLE = "subtitle";
public static final String SUMMARY = "summary";
@Override @Override
@ -67,13 +69,28 @@ public class NSITunes extends Namespace {
} else { } else {
return; return;
} }
state.getTempObjects().put(DURATION, duration); state.getTempObjects().put(DURATION, duration);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
e.printStackTrace(); 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);
}
} }
} }
} }