Example #1
0
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
}
Example #2
0
func (c *Client) playlist(name string, tracks []*vfs.Track) {
	c.conn.WriteLine(name)
	for _, t := range tracks {
		c.conn.WriteLine(serialize.Track(t))
	}
}