Esempio n. 1
0
func tag(t track.Track, trackPath string) error {
	tag, err := id3v2.Open(trackPath)
	if err != nil {
		return err
	}
	defer tag.Close()

	// If there are already frames in tag, do nothing
	if tag.Count() > 0 {
		return nil
	}

	tag.SetArtist(t.Artist())
	tag.SetTitle(t.Title())
	return tag.Save()
}
Esempio n. 2
0
func downloadTrack(t track.Track, path string) error {
	ui.Println("Downloading " + t.Artist() + " - " + t.Title())
	return runDownloadCmd(path, t.URL())
}