summaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorH. Lehmann <ByteHamster@users.noreply.github.com>2018-07-09 12:43:25 +0200
committerGitHub <noreply@github.com>2018-07-09 12:43:25 +0200
commiteff72db7c480af33db719ea47059ac68bb6852d9 (patch)
treef364d38a786305eb438d3d06a64053255cd0be3c /core/src/main
parent122b34bb606c582eb578f3d8b0021e6c589c3c50 (diff)
parent43911c3dab9e7f3ae91f3eac78f178509d6caccd (diff)
downloadAntennaPod-eff72db7c480af33db719ea47059ac68bb6852d9.zip
Merge pull request #2754 from AntennaPod/bugfix/2749-parse-error
Assume version 2.0 for RSS if property is missing
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java
index 54a0b1b97..b4c77e58d 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java
@@ -54,19 +54,19 @@ public class TypeGetter {
return Type.ATOM;
case RSS_ROOT:
String strVersion = xpp.getAttributeValue(null, "version");
- if (strVersion != null) {
- if (strVersion.equals("2.0")) {
- feed.setType(Feed.TYPE_RSS2);
- Log.d(TAG, "Recognized type RSS 2.0");
- return Type.RSS20;
- } else if (strVersion.equals("0.91")
- || strVersion.equals("0.92")) {
- Log.d(TAG, "Recognized type RSS 0.91/0.92");
- return Type.RSS091;
- }
- throw new UnsupportedFeedtypeException("Unsupported rss version");
+ if (strVersion == null) {
+ feed.setType(Feed.TYPE_RSS2);
+ Log.d(TAG, "Assuming type RSS 2.0");
+ return Type.RSS20;
+ } else if (strVersion.equals("2.0")) {
+ feed.setType(Feed.TYPE_RSS2);
+ Log.d(TAG, "Recognized type RSS 2.0");
+ return Type.RSS20;
+ } else if (strVersion.equals("0.91") || strVersion.equals("0.92")) {
+ Log.d(TAG, "Recognized type RSS 0.91/0.92");
+ return Type.RSS091;
}
- throw new UnsupportedFeedtypeException("No rss version attribute found");
+ throw new UnsupportedFeedtypeException("Unsupported rss version");
default:
Log.d(TAG, "Type is invalid");
throw new UnsupportedFeedtypeException(Type.INVALID, tag);