505d83e90f8067375c305d11e13164ba67322031

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Use album artist when available

Diff

 1diff --git a/catalog.go b/catalog.go
 2index 0e1f6920118376d576a0cc66062a13456a42f783..93ef5cbf81026fe37bad4040ddb384e4cd8e3e39 100644
 3--- a/catalog.go
 4+++ b/catalog.go
 5@@ -155,6 +155,9 @@ func readSong(path string) Song {
 6 			}
 7 			artist = m.Artist()
 8 			album = m.Album()
 9+			if aa := m.AlbumArtist(); aa != "" {
10+				artist = aa
11+			}
12 		}
13 	}
14 	return Song{Path: path, Title: title, Artist: artist, Album: album}
15diff --git a/main.go b/main.go
16index 0644c5b0f3b94123683e31903c58dd1b7a8b51f6..0ef9e880184787594738cd45eb14b22cf0701358 100644
17--- a/main.go
18+++ b/main.go
19@@ -16,7 +16,7 @@ func main() {
20 
21 	fmt.Printf("Scanning %s …\n", *dir)
22 	catalog, stats, err := buildCatalog(*dir, *blacklist, func(n, total int) {
23-		fmt.Printf("\r  %d%%\x1b[K", n*100/total)
24+		fmt.Printf("\r  %d/%d (%d%%)\x1b[K", n, total, n*100/total)
25 	})
26 	if err != nil {
27 		fmt.Fprintf(os.Stderr, "\nerror building catalog: %v\n", err)