TypeGetter is now setting type attribute of feed
This commit is contained in:
parent
02b2ec56c8
commit
9da07b8e72
|
@ -10,8 +10,8 @@ import java.util.Date;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Feed extends FeedFile {
|
public class Feed extends FeedFile {
|
||||||
private static final String TYPE_RSS2 = "rss";
|
public static final String TYPE_RSS2 = "rss";
|
||||||
private static final String TYPE_ATOM1 = "atom";
|
public static final String TYPE_ATOM1 = "atom";
|
||||||
|
|
||||||
private String title;
|
private String title;
|
||||||
/** Link to the website. */
|
/** Link to the website. */
|
||||||
|
|
|
@ -361,7 +361,9 @@ public class FeedManager {
|
||||||
markItemRead(context, item, false);
|
markItemRead(context, item, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// update attributes
|
||||||
savedFeed.setLastUpdate(newFeed.getLastUpdate());
|
savedFeed.setLastUpdate(newFeed.getLastUpdate());
|
||||||
|
savedFeed.setType(newFeed.getType());
|
||||||
setFeed(context, savedFeed);
|
setFeed(context, savedFeed);
|
||||||
return savedFeed;
|
return savedFeed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,12 +40,14 @@ public class TypeGetter {
|
||||||
if (eventType == XmlPullParser.START_TAG) {
|
if (eventType == XmlPullParser.START_TAG) {
|
||||||
String tag = xpp.getName();
|
String tag = xpp.getName();
|
||||||
if (tag.equals(ATOM_ROOT)) {
|
if (tag.equals(ATOM_ROOT)) {
|
||||||
|
feed.setType(Feed.TYPE_ATOM1);
|
||||||
if (AppConfig.DEBUG)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG, "Recognized type Atom");
|
Log.d(TAG, "Recognized type Atom");
|
||||||
return Type.ATOM;
|
return Type.ATOM;
|
||||||
} else if (tag.equals(RSS_ROOT)
|
} else if (tag.equals(RSS_ROOT)
|
||||||
&& (xpp.getAttributeValue(null, "version")
|
&& (xpp.getAttributeValue(null, "version")
|
||||||
.equals("2.0"))) {
|
.equals("2.0"))) {
|
||||||
|
feed.setType(Feed.TYPE_RSS2);
|
||||||
if (AppConfig.DEBUG)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG, "Recognized type RSS 2.0");
|
Log.d(TAG, "Recognized type RSS 2.0");
|
||||||
return Type.RSS20;
|
return Type.RSS20;
|
||||||
|
|
Loading…
Reference in New Issue