Esempio n. 1
0
func (tks Tracks) AddTrack(path, playlist string) (Track, error) {
	uuid := utils.Uuidgen("track")
	tk := &Track{Uuid: uuid, Path: path, Playlist: playlist}
	tks[uuid] = tk
	return *tk, nil
}
Esempio n. 2
0
func (pls Playlists) AddPlaylist(name string) (Playlist, error) {
	uuid := utils.Uuidgen("playlist")
	pl := &Playlist{Uuid: uuid, Name: name, Tracks: make([]string, 0)}
	pls[uuid] = pl
	return *pl, nil
}