This commit is contained in:
Florian Hoss 2024-09-30 22:03:58 +02:00
parent c31c6243da
commit 8c5b698acb
Signed by: flohoss
GPG key ID: 5BA0B454E498DF62

View file

@ -140,11 +140,10 @@ func downloadIcon(title, url string) ([]byte, error) {
} }
func handleSelfHostedIcons(icon, ext string) (string, string, string, string) { func handleSelfHostedIcons(icon, ext string) (string, string, string, string) {
ext = strings.TrimPrefix(ext, ".")
title := strings.Replace(icon, "shi/", "", 1) title := strings.Replace(icon, "shi/", "", 1)
url := "https://cdn.jsdelivr.net/gh/selfhst/icons/" + ext + "/" + title url := "https://cdn.jsdelivr.net/gh/selfhst/icons/" + strings.TrimPrefix(ext, ".") + "/" + title
lightTitle := strings.Replace(title, ext, "-light.svg", 1) lightTitle := strings.Replace(title, ext, "-light.svg", 1)
lightUrl := "https://cdn.jsdelivr.net/gh/selfhst/icons/" + ext + "/" + lightTitle lightUrl := "https://cdn.jsdelivr.net/gh/selfhst/icons/" + strings.TrimPrefix(ext, ".") + "/" + lightTitle
return title, url, lightTitle, lightUrl return title, url, lightTitle, lightUrl
} }