示例#1
0
文件: client.go 项目: vchimishuk/chub
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
}
示例#2
0
文件: client.go 项目: vchimishuk/chub
func (c *Client) playlist(name string, tracks []*vfs.Track) {
	c.conn.WriteLine(name)
	for _, t := range tracks {
		c.conn.WriteLine(serialize.Track(t))
	}
}