summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/syndication
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-11-01 19:57:06 +0100
committerdaniel oeh <daniel.oeh@gmail.com>2012-11-01 19:57:06 +0100
commit38439db85dc0ba34e068c349e7cde5d6c96cd7af (patch)
treefb0c3a8b1d6ccaa39f6604469e6b3be3bf9f8180 /src/de/danoeh/antennapod/syndication
parent8c541fb82d2470b9c97eb12b5d121e3c283e0ab1 (diff)
downloadAntennaPod-38439db85dc0ba34e068c349e7cde5d6c96cd7af.zip
Added support for RSS 0.91/0.92
Diffstat (limited to 'src/de/danoeh/antennapod/syndication')
-rw-r--r--src/de/danoeh/antennapod/syndication/handler/SyndHandler.java2
-rw-r--r--src/de/danoeh/antennapod/syndication/handler/TypeGetter.java28
2 files changed, 21 insertions, 9 deletions
diff --git a/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java b/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java
index ff7942cdb..55757ce18 100644
--- a/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java
+++ b/src/de/danoeh/antennapod/syndication/handler/SyndHandler.java
@@ -23,7 +23,7 @@ public class SyndHandler extends DefaultHandler {
public SyndHandler(Feed feed, TypeGetter.Type type) {
state = new HandlerState(feed);
- if (type == TypeGetter.Type.RSS20) {
+ if (type == TypeGetter.Type.RSS20 || type == TypeGetter.Type.RSS091) {
state.defaultNamespaces.push(new NSRSS20());
}
}
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");