fix
This commit is contained in:
parent
b30459f748
commit
3e90946f8b
8
main.go
8
main.go
@ -410,11 +410,11 @@ func getSongLyrics(songId string, storefront string, token string, userToken str
|
|||||||
}
|
}
|
||||||
defer do.Body.Close()
|
defer do.Body.Close()
|
||||||
obj := new(structs.SongLyrics)
|
obj := new(structs.SongLyrics)
|
||||||
err = json.NewDecoder(do.Body).Decode(&obj)
|
_ = json.NewDecoder(do.Body).Decode(&obj)
|
||||||
if err != nil {
|
if obj.Data != nil {
|
||||||
return "", errors.New("failed to get lyrics")
|
|
||||||
} else {
|
|
||||||
return obj.Data[0].Attributes.Ttml, nil
|
return obj.Data[0].Attributes.Ttml, nil
|
||||||
|
} else {
|
||||||
|
return "", errors.New("failed to get lyrics")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user