Mass fix of genre tag

724 views
Skip to first unread message

Luciano Fiandesio

unread,
Oct 24, 2014, 9:53:27 AM10/24/14
to beets...@googlegroups.com
Hi,
I'm a beets user and I'm trying to do the following: I would like to "mass-fix" the genre tag in my mp3/flac collections.
Basically, I would like to do an import that doesn't move/copy the files and only changes the genre tag using the lastgenre plugin.

Is there a way to achieve this?

Thanks!

Luciano

Michael MacLeod

unread,
Oct 24, 2014, 10:45:51 AM10/24/14
to beets...@googlegroups.com

Luciano,

I'll let someone else handle the correct settings to use to keep everything in place and not update any fields except genre, but I do have some advice about the lastgenre plugin specifically.

The lastgenre plugin includes a massive genre tag whitelist (genres.txt) by default, with over 1100 different genres. It also includes a canonicalization tree (genres-tree.yaml) with a bit over 400 genres. Every genre in the tree is present in the whitelist, which means that in its default configuration the lastgenre plugin does no canonicalization whatsoever, even if you have it configured to do so, because it never has to walk the tree to find a match from the whitelist. You're just getting the top tag from last.fm directly (I ended up with well over a hundred genres, many of them with only a single album).

To get the most out of the plugin take a look at the yaml tree and make sure you agree with how it's laid out (I used it as a template but created a custom version of it). Then create a custom whitelist with just the genres you want - I have 26 genres in my genres.txt - with music that is under-represented in my collection (country, folk, punk, reggae) grouped coarsely, and music that is over-represented (electronic and hop hop, primarily) broken down into the second level sub-grenres. This makes the genres view of my collection actually functional for the first time in a very, very long time.

Hope that helps,

Mike

--
You received this message because you are subscribed to the Google Groups "beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beets-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adrian Sampson

unread,
Oct 24, 2014, 12:01:30 PM10/24/14
to beets...@googlegroups.com

> On Oct 24, 2014, at 6:53 AM, Luciano Fiandesio <luciano....@gmail.com> wrote:
>
> Basically, I would like to do an import that doesn't move/copy the files and only changes the genre tag using the lastgenre plugin.

Yes, you can configure the import not to move or write tags (and even not to auto-tag if you like!). Then run the `beet lastgenre` command.

Luciano Fiandesio

unread,
Oct 24, 2014, 12:39:30 PM10/24/14
to beets...@googlegroups.com
Hi Mike,

thanks for the tips. I was planning to follow this guy's recommendation for the genre setup: http://kray.me/blog/customizing-beet-genres-canonicalization-tree/

Cheers
Luciano

Fabrice Laporte

unread,
Oct 26, 2014, 4:47:10 PM10/26/14
to beets...@googlegroups.com
Yup, I'm "the guy" but Mike laid out the explanations well, in tune with my blog post :)

Luciano Fiandesio

unread,
Oct 30, 2014, 4:07:00 AM10/30/14
to beets...@googlegroups.com
Hi Adrian

I'm not sure I understand the setup.
I have configured beets like so:

import:
  move:  no
  write: no
  copy: no
  autotag: no

but I'm not clear about which command to run. It seems that "beet lastgenre" it's a query command, not a write command. Shall I use import instead?
I tried different combinations, but nothing seems to work, except the standard move:yes and write:yes settings.

Thanks
Luciano

Kraymer

unread,
Oct 30, 2014, 6:18:47 AM10/30/14
to beets...@googlegroups.com
For the plugin to work on import, you must declare it first in your config file.

Then, by running `beet import <path>`, beet will import files in your library and will fetch lastgenre genres in the process.

--
You received this message because you are subscribed to a topic in the Google Groups "beets" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beets-users/6W1t-Phpbsc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beets-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Fabrice

Luciano Fiandesio

unread,
Oct 30, 2014, 6:56:07 AM10/30/14
to beets...@googlegroups.com
Hi Fabrice, thanks.
I have already the plugin installed and works great. It's just that I was a bit confused by Adrian reply because he says to run the "beet lastgenre" command, which, from what I understand it doesn't write to files.

Luciano

Tim Stackhouse

unread,
Oct 30, 2014, 11:00:06 AM10/30/14
to beets...@googlegroups.com
Hi Luciano,

I've been diving into the lastgenre plugin myself recently, and the command _does_ write to the files/db (depending on your configuration), but only to files that already exist in your library.  Any files that you import with `beet import` will be tagged appropriately at import time, if that's how you're configured.

Hope this helps!
Tim


We can only see a short distance ahead, but we can see plenty there that needs to be done.  --Alan Turing, 1950

--
You received this message because you are subscribed to the Google Groups "beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beets-users...@googlegroups.com.

Adrian Sampson

unread,
Oct 30, 2014, 12:20:30 PM10/30/14
to beets...@googlegroups.com
Thanks, Tim—totally right.

Luciano, I may have misunderstood what you were trying to do. If you already have the genre correct in your library database, and now you need to write it back to the tags on the files themselves, you might want the `beet write` command:
http://docs.beets.io/en/v1.3.8/reference/cli.html#write

Adrian

Luciano Fiandesio

unread,
Oct 30, 2014, 2:33:34 PM10/30/14
to beets...@googlegroups.com
Guys, I have a question about whitelist and canonicalization list.
Say that my custom whitelist has only 5 genres and my custom canon list has 6 genres. An example should be simpler to explain:


whitelist
A
B
C
D
E

canon list
- A
  - B
  - C
- D
  - E
  - F


So, if last.fm returns the "F" genre will it be ignored because is not on the whitelist or it will be "computed" and the "D" genre will be chosen, as F is on the canon list? I hope it makes sense :)

Thanks
Luciano

Tim Stackhouse

unread,
Oct 30, 2014, 3:01:33 PM10/30/14
to beets...@googlegroups.com
I think the latter is the case, if you've got F in your tree, but not in the whitelist, it will traverse up the tree to D and use that, provided you have canonical: true in your config.yaml for the lastgenre plugin.


We can only see a short distance ahead, but we can see plenty there that needs to be done.  --Alan Turing, 1950

Tim Stackhouse

unread,
Oct 30, 2014, 3:02:55 PM10/30/14
to beets...@googlegroups.com
I'm personally one step behind you, trying to tag everything with what last.fm thinks the genre are, than I can work on paring my whitelist and possibly customizing the canonicalization tree to make the genres into roughly equally sized buckets.


We can only see a short distance ahead, but we can see plenty there that needs to be done.  --Alan Turing, 1950

Adrian Sampson

unread,
Oct 30, 2014, 5:20:05 PM10/30/14
to beets...@googlegroups.com
In that case you do indeed want the `beet lastgenre` command as I originally supposed. Just run that.

Kraymer

unread,
Oct 30, 2014, 5:22:22 PM10/30/14
to beets...@googlegroups.com

Yep D will be chosen

Reply all
Reply to author
Forward
0 new messages