mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 00:21:55 +00:00
22 lines
493 B
Go
22 lines
493 B
Go
|
package goscrobble
|
||
|
|
||
|
type ProfileResponse struct {
|
||
|
UUID string `json:"uuid"`
|
||
|
Username string `json:"username"`
|
||
|
Scrobbles []ScrobbleRequestItem `json:"scrobbles"`
|
||
|
}
|
||
|
|
||
|
func getProfile(user User) (ProfileResponse, error) {
|
||
|
resp := ProfileResponse{
|
||
|
UUID: user.UUID,
|
||
|
Username: user.Username,
|
||
|
}
|
||
|
scrobbleReq, err := fetchScrobblesForUser(user.UUID, 10, 1)
|
||
|
if err != nil {
|
||
|
return resp, err
|
||
|
}
|
||
|
|
||
|
resp.Scrobbles = scrobbleReq.Items
|
||
|
return resp, nil
|
||
|
}
|