func wrapUpAlbum(album *model.Album, artist *model.Artist, category *model.Category) { album.Category = category.Name if artist != nil { album.Artist = artist.Name artist.Albums = append(artist.Albums, album) } else { // bare album, no artist category.Albums = append(category.Albums, album) } }
func wrapUpArtist(artist *model.Artist, category *model.Category) { category.Artists = append(category.Artists, artist) }