Add support for rss feeds which does not have any atom:link tag in their channel tag
This commit is contained in:
parent
7bbf038aa8
commit
2b0bf9f63d
@ -8,6 +8,7 @@ import com.readrops.readropslibrary.Utils.Utils;
|
|||||||
import com.readrops.readropslibrary.localfeed.atom.ATOMFeed;
|
import com.readrops.readropslibrary.localfeed.atom.ATOMFeed;
|
||||||
import com.readrops.readropslibrary.localfeed.json.JSONFeed;
|
import com.readrops.readropslibrary.localfeed.json.JSONFeed;
|
||||||
import com.readrops.readropslibrary.localfeed.rss.RSSFeed;
|
import com.readrops.readropslibrary.localfeed.rss.RSSFeed;
|
||||||
|
import com.readrops.readropslibrary.localfeed.rss.RSSLink;
|
||||||
|
|
||||||
import org.simpleframework.xml.Serializer;
|
import org.simpleframework.xml.Serializer;
|
||||||
import org.simpleframework.xml.core.Persister;
|
import org.simpleframework.xml.core.Persister;
|
||||||
@ -75,6 +76,9 @@ public class RSSNetwork {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case RSS_2:
|
case RSS_2:
|
||||||
RSSFeed rssFeed = serializer.read(RSSFeed.class, xml);
|
RSSFeed rssFeed = serializer.read(RSSFeed.class, xml);
|
||||||
|
if (rssFeed.getChannel().getFeedUrl() == null) // workaround si the channel does not have any atom:link tag
|
||||||
|
rssFeed.getChannel().getLinks().add(new RSSLink(null, url));
|
||||||
|
|
||||||
callback.onSyncSuccess(rssFeed, type);
|
callback.onSyncSuccess(rssFeed, type);
|
||||||
break;
|
break;
|
||||||
case RSS_ATOM:
|
case RSS_ATOM:
|
||||||
|
@ -14,6 +14,15 @@ public class RSSLink {
|
|||||||
@Attribute(name = "href", required = false)
|
@Attribute(name = "href", required = false)
|
||||||
private String href;
|
private String href;
|
||||||
|
|
||||||
|
public RSSLink() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RSSLink(String text, String href) {
|
||||||
|
this.text = text;
|
||||||
|
this.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
public String getHref() {
|
public String getHref() {
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user