improved homepage support, memory leak partial fix

This commit is contained in:
yusing
2024-10-03 20:02:43 +08:00
parent 4f09dbf044
commit de6c1be51b
7 changed files with 42 additions and 32 deletions

View File

@@ -71,17 +71,11 @@ func (cfg *Config) HomepageConfig() H.HomePageConfig {
if item.Category == "" {
item.Category = "Docker"
}
if item.Icon == "" {
item.Icon = "🐳"
}
item.SourceType = string(PR.ProviderTypeDocker)
} else if p.GetType() == PR.ProviderTypeFile {
if item.Category == "" {
item.Category = "Others"
}
if item.Icon == "" {
item.Icon = "🔗"
}
item.SourceType = string(PR.ProviderTypeFile)
}
@@ -90,6 +84,7 @@ func (cfg *Config) HomepageConfig() H.HomePageConfig {
item.URL = fmt.Sprintf("%s://%s.%s:%s", proto, strings.ToLower(alias), domains[0], port)
}
}
item.AltURL = r.URL().String()
hpCfg.Add(&item)
})