mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-12-13 19:55:21 +00:00
Add user to albums
This commit is contained in:
15
api/album.go
15
api/album.go
@@ -78,7 +78,7 @@ func ParseAlbum(data gjson.Result) (types.Album, error) {
|
||||
return types.Album{}, err
|
||||
}
|
||||
|
||||
return types.Album{
|
||||
album := types.Album{
|
||||
Id: data.Get("id").String(),
|
||||
Title: data.Get("title").String(),
|
||||
SharedWithCommunity: data.Get("shared_with_community").Bool(),
|
||||
@@ -88,5 +88,16 @@ func ParseAlbum(data gjson.Result) (types.Album, error) {
|
||||
Comments: data.Get("comment_count").Int(),
|
||||
CreatedAt: createdAt,
|
||||
Media: media,
|
||||
}, nil
|
||||
}
|
||||
|
||||
account := data.Get("account")
|
||||
if account.Raw != "" {
|
||||
album.User = types.User{
|
||||
Id: account.Get("id").Int(),
|
||||
Username: account.Get("username").String(),
|
||||
Avatar: strings.ReplaceAll(account.Get("avatar_url").String(), "https://i.imgur.com", ""),
|
||||
}
|
||||
}
|
||||
|
||||
return album, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user