diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-11-01 19:57:06 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-11-01 19:57:06 +0100 |
commit | 38439db85dc0ba34e068c349e7cde5d6c96cd7af (patch) | |
tree | fb0c3a8b1d6ccaa39f6604469e6b3be3bf9f8180 /src/de/danoeh/antennapod/syndication/handler/TypeGetter.java | |
parent | 8c541fb82d2470b9c97eb12b5d121e3c283e0ab1 (diff) | |
download | AntennaPod-38439db85dc0ba34e068c349e7cde5d6c96cd7af.zip |
Added support for RSS 0.91/0.92
Diffstat (limited to 'src/de/danoeh/antennapod/syndication/handler/TypeGetter.java')
-rw-r--r-- | src/de/danoeh/antennapod/syndication/handler/TypeGetter.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/de/danoeh/antennapod/syndication/handler/TypeGetter.java b/src/de/danoeh/antennapod/syndication/handler/TypeGetter.java index a2766526d..d2454f2b9 100644 --- a/src/de/danoeh/antennapod/syndication/handler/TypeGetter.java +++ b/src/de/danoeh/antennapod/syndication/handler/TypeGetter.java @@ -19,7 +19,7 @@ public class TypeGetter { private static final String TAG = "TypeGetter"; enum Type { - RSS20, ATOM, INVALID + RSS20, RSS091, ATOM, INVALID } private static final String ATOM_ROOT = "feed"; @@ -43,13 +43,25 @@ public class TypeGetter { if (AppConfig.DEBUG) Log.d(TAG, "Recognized type Atom"); return Type.ATOM; - } else if (tag.equals(RSS_ROOT) - && (xpp.getAttributeValue(null, "version") - .equals("2.0"))) { - feed.setType(Feed.TYPE_RSS2); - if (AppConfig.DEBUG) - Log.d(TAG, "Recognized type RSS 2.0"); - return Type.RSS20; + } else if (tag.equals(RSS_ROOT)) { + String strVersion = xpp.getAttributeValue(null, + "version"); + if (strVersion != null) { + + if (strVersion.equals("2.0")) { + feed.setType(Feed.TYPE_RSS2); + if (AppConfig.DEBUG) + Log.d(TAG, "Recognized type RSS 2.0"); + return Type.RSS20; + } else if (strVersion.equals("0.91") + || strVersion.equals("0.92")) { + if (AppConfig.DEBUG) + Log.d(TAG, + "Recognized type RSS 0.91/0.92"); + return Type.RSS091; + } + } + throw new UnsupportedFeedtypeException(Type.INVALID); } else { if (AppConfig.DEBUG) Log.d(TAG, "Type is invalid"); |