Skip to content

Commit

Permalink
Use RSSParser image for favicons
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Jun 27, 2024
1 parent aa9479d commit 6822220
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ class LocalAccountDelegate(
subscription_id = feedURL,
title = feed.name,
feed_url = feedURL,
site_url = feed.siteURL.toString(),
favicon_url = null
site_url = feed.siteURL?.toString(),
favicon_url = feed.faviconURL?.toString()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ class LocalAccountDelegateTest {
private data class TestFeed(
override val name: String,
override val feedURL: URL,
override val siteURL: URL? = null
override val siteURL: URL? = null,
override val faviconURL: URL? = null
) : Feed {
override fun isValid() = true
}
Expand Down
2 changes: 2 additions & 0 deletions feedfinder/src/main/java/com/jocmp/feedfinder/parser/Feed.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ interface Feed {
val feedURL: URL

val siteURL: URL?

val faviconURL: URL?
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ internal class XMLFeed(
get() = channel?.link?.let {
URL(it)
}
override val faviconURL: URL?
get() = channel?.image?.url?.let { URL(it) }

private fun hasEntries(): Boolean {
return channel != null &&
Expand Down

0 comments on commit 6822220

Please sign in to comment.