From d07afe16ae5235a4da4018997d66323fcf6b2b45 Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Sat, 15 Dec 2012 18:51:33 +0100 Subject: [PATCH] OPML reader now uses 'title' attribute if available --- src/de/danoeh/antennapod/opml/OpmlReader.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/de/danoeh/antennapod/opml/OpmlReader.java b/src/de/danoeh/antennapod/opml/OpmlReader.java index 6f16a8f34..c05ce61e2 100644 --- a/src/de/danoeh/antennapod/opml/OpmlReader.java +++ b/src/de/danoeh/antennapod/opml/OpmlReader.java @@ -56,7 +56,15 @@ public class OpmlReader { if (AppConfig.DEBUG) Log.d(TAG, "Found new Opml element"); OpmlElement element = new OpmlElement(); - element.setText(xpp.getAttributeValue(null, OpmlSymbols.TEXT)); + + final String title = xpp.getAttributeValue(null, OpmlSymbols.TITLE); + if (title != null) { + Log.i(TAG, "Using title: " + title); + element.setText(title); + } else { + Log.i(TAG, "Title not found, using text"); + element.setText(xpp.getAttributeValue(null, OpmlSymbols.TEXT)); + } element.setXmlUrl(xpp.getAttributeValue(null, OpmlSymbols.XMLURL)); element.setHtmlUrl(xpp.getAttributeValue(null, OpmlSymbols.HTMLURL)); element.setType(xpp.getAttributeValue(null, OpmlSymbols.TYPE));