Beispiel #1
0
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)
	}
}
Beispiel #2
0
func wrapUpArtist(artist *model.Artist, category *model.Category) {
	category.Artists = append(category.Artists, artist)
}