- Fix artist/album/track images
This commit is contained in:
Daniel Mason 2021-04-17 11:34:53 +12:00
parent 8bc462878a
commit 65b4c78137
Signed by: idanoo
GPG key ID: 387387CDBC02F132
12 changed files with 29 additions and 12 deletions

View file

@ -38,9 +38,13 @@ func importImage(uuid string, url string) error {
return err
}
// Goroutine the resize to keep it _faaaast_
go resizeImage(uuid)
return nil
}
func resizeImage(uuid string) error {
return nil
func resizeImage(uuid string) {
// resize to 300x300 and maybe smaller?
return
}

View file

@ -238,7 +238,7 @@ func (user *User) updateImageDataFromSpotify() error {
client := auth.NewClient(token)
client.AutoRetry = true
rows, err := db.Query("SELECT BIN_TO_UUID(`uuid`, true), `name` FROM `artists` WHERE IFNULL(`img`,'') NOT IN ('pending', 'complete') LIMIT 50")
rows, err := db.Query("SELECT BIN_TO_UUID(`uuid`, true), `name` FROM `artists` WHERE IFNULL(`img`,'') NOT IN ('pending', 'complete') LIMIT 100")
if err != nil {
log.Printf("Failed to fetch config: %+v", err)
return errors.New("Failed to fetch artists")
@ -282,7 +282,7 @@ func (user *User) updateImageDataFromSpotify() error {
}
tx.Commit()
rows, err = db.Query("SELECT BIN_TO_UUID(`uuid`, true), `name` FROM `albums` WHERE IFNULL(`img`,'') NOT IN ('pending', 'complete') LIMIT 50")
rows, err = db.Query("SELECT BIN_TO_UUID(`uuid`, true), `name` FROM `albums` WHERE IFNULL(`img`,'') NOT IN ('pending', 'complete') LIMIT 100")
if err != nil {
log.Printf("Failed to fetch config: %+v", err)
return errors.New("Failed to fetch artists")

View file

@ -740,7 +740,7 @@ func getServerInfo(w http.ResponseWriter, r *http.Request) {
}
info := ServerInfo{
Version: "0.0.29",
Version: "0.0.30",
RegistrationEnabled: cachedRegistrationEnabled,
}

View file

@ -8,9 +8,6 @@ import (
var endTicker chan bool
func StartBackgroundWorkers() {
user, _ := getUserByUsername("idanoo")
go user.updateImageDataFromSpotify()
endTicker := make(chan bool)
hourTicker := time.NewTicker(time.Duration(1) * time.Hour)