Set genre of tracks to genre off album?


beets is great - I really love it.
Now I am sorting out my genres.

I had some albums, where the genre of the album is different to the genre of the tracks. I would prefer to have them in sync, as I use only one genre per album.

How can I

  1. see which albums have different genres than the tracks?
  2. set the genre of the tracks to the genre of the album (or vice versa)?



Good question; this does seem like something that should be possible but I don’t currently know of an obvious way to do it in a batch. Does it work to use beet modify -a to change the album’s field back to what it already is?

Haven’t tried setting it to what is is.

But that still leaves the question on how to find the ones which are different between Album and Track (and possibly look which ones are correct).

One ways (on Linux and Mac - don’t know about Windows) of saving the results of these two commands to a file (album.csv) (> overwrites the file, >> appends to the file)

beet list -af '$album, $genre' | sort | uniq > albums.txt
beet list  -f '$album, $genre' | sort | uniq >> albums.txt

after that, read the file, sort it, get the unique ones including count, and sort again:

cat albums.txt | sort | uniq -c | sort

this results in a long list like

   1 Animal Magic, Chillout
   1 Animal Magic, Electronic
   1 Grosse Freiheit (Winteredition),
   1 Ibiza: The History of Chillout, Chillout
   1 Ibiza: The History of Chillout, Electronic
   1 Karma, Electronic
   1 Karma, House
   1 Paris Lounge 4, Elecronic
   1 Paris Lounge 4, Electronic
   1 Saint-Germain-des-Prés Café, Volume 2, Elecronic
   1 Saint-Germain-des-Prés Café, Volume 2, Electronic
   1 The HDtracks Ultimate Download Experience (2011), Jazz
   2 #JeSuisCharlie, Singer & Songwriter
   2 ...Nothing Like the Sun, Rock
   2 0898 Beautiful South, Rock
   2 1 Giant Leap, Electronic
   2 10 Years Solo Live, Jazz
   2 100 grandes chansons françaises, Variété française
   2 18, Ambient
   2 1962–1966, Rock
   2 1967–1970, Rock

where the first ones (with 1) indicate different genres, for one album, and two or more different genres er album and tracks.

So now, I know the ones with more than one genre.

1 Like