mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.0.30
- Fix artist/album/track images
This commit is contained in:
parent
8bc462878a
commit
65b4c78137
12 changed files with 29 additions and 12 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -740,7 +740,7 @@ func getServerInfo(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
info := ServerInfo{
|
||||
Version: "0.0.29",
|
||||
Version: "0.0.30",
|
||||
RegistrationEnabled: cachedRegistrationEnabled,
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue