func (c *Client) playlist(name string) ([]string, error) { plist, err := c.player.Playlist(name) if err != nil { return nil, err } tracks := plist.Tracks() lines := make([]string, 0, tracks.Len()) for i := 0; i < tracks.Len(); i++ { lines = append(lines, serialize.Track(tracks.Get(i))) } return lines, nil }
func (c *Client) playlist(name string, tracks []*vfs.Track) { c.conn.WriteLine(name) for _, t := range tracks { c.conn.WriteLine(serialize.Track(t)) } }