Skip to content

Commit

Permalink
feat: support custom site icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Daydreamer-riri committed Apr 25, 2024
1 parent fd02007 commit 8b81149
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public partial class Item

public bool? IsDefault { get; set; }

public string? IconUrl { get; set; }

public string Domain {
get
{
Expand Down Expand Up @@ -74,7 +76,7 @@ private async Task<byte[]> DownloadFaviconAsync()
using HttpClient client = new();
client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");

string faviconUrl = Domain + "/favicon.ico";
string faviconUrl = !string.IsNullOrEmpty(IconUrl) ? IconUrl : Domain + "/favicon.ico";
HttpResponseMessage response = await client.GetAsync(faviconUrl);
if (
response.IsSuccessStatusCode
Expand Down

0 comments on commit 8b81149

Please sign in to comment.