mirror of https://github.com/readrops/Readrops.git
Use nullable attributes in ATOM adapters
This commit is contained in:
parent
0eb518d692
commit
581de2e1dd
|
@ -38,7 +38,7 @@ class ATOMFeedAdapter : XmlAdapter<Feed> {
|
|||
}
|
||||
|
||||
private fun parseLink(konsume: Konsumer, feed: Feed) {
|
||||
val rel = konsume.attributes["rel"]
|
||||
val rel = konsume.attributes.getValueOpt("rel")
|
||||
|
||||
if (rel == "self")
|
||||
feed.url = konsume.attributes["href"]
|
||||
|
|
|
@ -26,7 +26,11 @@ class ATOMItemsAdapter : XmlAdapter<List<Item>> {
|
|||
"title" -> title = nonNullText()
|
||||
"id" -> guid = nullableText()
|
||||
"updated" -> pubDate = DateUtils.stringToLocalDateTime(nonNullText())
|
||||
"link" -> if (attributes["rel"] == "alternate") link = attributes["href"]
|
||||
"link" -> {
|
||||
if (attributes.getValueOpt("rel") == null ||
|
||||
attributes["rel"] == "alternate")
|
||||
link = attributes["href"]
|
||||
}
|
||||
"author" -> allChildrenAutoIgnore("name") { author = text() }
|
||||
"summary" -> description = nullableText()
|
||||
"content" -> content = nullableText()
|
||||
|
|
Loading…
Reference in New Issue