Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RSSParser image for favicons #124

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading