Commits

Robert Lowry committed ec89fcc

changed 'Name' to 'Title'

  • Participants
  • Parent commits 9d2eac6

Comments (0)

Files changed (8)

 
 // A parsed ID3 file with common fields exposed.
 type SimpleTags struct {
-	Name   string
+	Title   string
 	Artist string
 	Album  string
 	Year   string
 		t.Errorf("Header.Size: expected %d got %d", header.Size, actual.Header.Size)
 	}
 
-	// Name, Artist, etc...
+	// Title, Artist, etc...
 	file := expected.file
-	if actual.Name != file.Name {
-		t.Errorf("Name: expected '%s' got '%s'", file.Name, actual.Name)
+	if actual.Title != file.Title {
+		t.Errorf("Title: expected '%s' got '%s'", file.Title, actual.Title)
 	}
 	if actual.Artist != file.Artist {
 		t.Errorf("Artist: expected '%s' got '%s'", file.Artist, actual.Artist)
 	if err != nil {
 		return nil, fmt.Errorf("read error")
 	}
-	tags.Name = strings.TrimRight(string(data), "\u0000")
+	tags.Title = strings.TrimRight(string(data), "\u0000")
 
 	data, err = readBytes(buf, 30)
 	if err != nil {
 			tags.Track = readID3v2String(lreader, size)
 		case "artist":
 			tags.Artist = readID3v2String(lreader, size)
-		case "name":
-			tags.Name = readID3v2String(lreader, size)
+		case "title":
+			tags.Title = readID3v2String(lreader, size)
 		case "year":
 			tags.Year = readID3v2String(lreader, size)
 		case "disc":
 	"TAL": "album",
 	"TRK": "track",
 	"TP1": "artist",
-	"TT2": "name",
+	"TT2": "title",
 	"TYE": "year",
 	"TPA": "disc",
 	"TCO": "genre",
 	"TALB": "album",
 	"TRCK": "track",
 	"TPE1": "artist",
-	"TIT2": "name",
+	"TIT2": "title",
 	"TYER": "year",
 	"TPOS": "disc",
 	"TCON": "genre",
 	"TALB": "album",
 	"TRCK": "track",
 	"TPE1": "artist",
-	"TIT2": "name",
+	"TIT2": "title",
 	"TDRC": "year",
 	"TPOS": "disc",
 	"TCON": "genre",

tagreader/main.go

 	}
 
 	fmt.Println(path)
-	fmt.Printf("Name\t%s\n", tags.Name)
+	fmt.Printf("Title\t%s\n", tags.Title)
 	fmt.Printf("Artist\t%s\n", tags.Artist)
 	fmt.Printf("Album\t%s\n", tags.Album)
 	fmt.Printf("Year\t%s\n", tags.Year)