fix cover.png maxsize

This commit is contained in:
itouakirai 2024-04-28 12:47:54 +08:00 committed by GitHub
parent 2781879312
commit cd0f0c99c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1063,6 +1063,11 @@ func writeCover(sanAlbumFolder, url string) error {
if exists { if exists {
return nil return nil
} }
if config.CoverFormat == "png" {
re := regexp.MustCompile(`\{w\}x\{h\}`)
parts := re.Split(url, 2)
url = parts[0] + "{w}x{h}" + strings.Replace(parts[1], ".jpg", ".png", 1)
}
url = strings.Replace(url, "{w}x{h}", config.CoverSize, 1) url = strings.Replace(url, "{w}x{h}", config.CoverSize, 1)
req, err := http.NewRequest("GET", url, nil) req, err := http.NewRequest("GET", url, nil)
if err != nil { if err != nil {