summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/syndication
diff options
context:
space:
mode:
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
-rw-r--r--src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java2
3 files changed, 22 insertions, 10 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");
diff --git a/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java b/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java
index 388e1540e..696fef6e1 100644
--- a/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java
+++ b/src/de/danoeh/antennapod/syndication/namespace/rss20/NSRSS20.java
@@ -101,7 +101,7 @@ public class NSRSS20 extends Namespace {
} else if (second.equals(CHANNEL)) {
state.getFeed().setTitle(content);
} else if (second.equals(IMAGE) && third != null && third.equals(CHANNEL)) {
- state.getFeed().getImage().setTitle(IMAGE);
+ state.getFeed().getImage().setTitle(content);
}
} else if (top.equals(LINK)) {
if (second.equals(CHANNEL)) {