fix cover.png maxsize

pull/14/head
itouakirai 5 months ago committed by GitHub
parent cd0f0c99c2
commit 3b774201c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      main_select.go

@ -1056,6 +1056,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 {

Loading…
Cancel
Save