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 }
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 }