mirror of https://github.com/readrops/Readrops.git
Fix some feed parsing failures
This commit is contained in:
parent
c115a1edcc
commit
99ff159434
|
@ -29,6 +29,7 @@ class ATOMFeedAdapter : XmlAdapter<Pair<Feed, List<Item>>> {
|
|||
"link" -> parseLink(this@allChildrenAutoIgnore, feed)
|
||||
"subtitle" -> description = nullableText()
|
||||
"entry" -> items += itemAdapter.fromXml(this@allChildrenAutoIgnore)
|
||||
else -> skipContents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ class RSS1FeedAdapter : XmlAdapter<Pair<Feed, List<Item>>> {
|
|||
when (tagName) {
|
||||
"channel" -> parseChannel(this, feed)
|
||||
"item" -> items += itemAdapter.fromXml(this)
|
||||
else -> skipContents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.readrops.app.compose.repositories
|
||||
|
||||
import android.util.Log
|
||||
import com.readrops.api.localfeed.LocalRSSDataSource
|
||||
import com.readrops.api.services.SyncResult
|
||||
import com.readrops.api.utils.ApiUtils
|
||||
|
@ -123,8 +124,12 @@ class LocalRSSRepository(
|
|||
etag = null
|
||||
lastModified = null
|
||||
|
||||
iconUrl = HtmlParser.getFaviconLink(siteUrl!!, get()).also { feedUrl ->
|
||||
feedUrl?.let { backgroundColor = FeedColors.getFeedColor(it) }
|
||||
try {
|
||||
iconUrl = HtmlParser.getFaviconLink(siteUrl!!, get()).also { feedUrl ->
|
||||
feedUrl?.let { backgroundColor = FeedColors.getFeedColor(it) }
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.d("LocalRSSRepository", "insertFeed: ${e.message}")
|
||||
}
|
||||
|
||||
id = database.newFeedDao().insert(this).toInt()
|
||||
|
|
Loading…
Reference in New Issue