Need help to (re)configure paths

As a long time user of beets (thank you very much @adrian !!!) i’m now in an situation where everything works but needs a little improvement. My directory “Various Artists” is confusing now with 870 subdirectories in it, i want to organize it a bit finer by introducing subdirectories based on genres.

  • Various Artists
    • Jazz
    • Electronica
    • MPB
      • all the rest

my current config is

    singleton: Singletons/$genre/$artist - $title
    comp: Various Artists/$album%aunique{} [$year] [$format]/%if{$disctitle,$disctitle/}$track $artist - $title
    albumtype:Audiobook: Hörspiele/$albumartist/$album%aunique{} [$format] [$year]/%if{$multidisc,disc $disc }%if{$disctitle,$disctitle}/$track $title
    albumtype:Hörspiel: Hörspiele/$albumartist/$album%aunique{} [$format] [$year]/%if{$multidisc,disc $disc }%if{$disctitle,$disctitle}/$track $title
    albumtype:Comedy: Hörspiele/$albumartist/$album%aunique{} [$format] [$year]/%if{$multidisc,disc $disc }%if{$disctitle,$disctitle}/$track $title
    albumtype:Soundtrack: Soundtrack/$albumartist/[$year] $album%aunique{} [$format]/%if{$multidisc,disc $disc }%if{$disctitle,$disctitle}/$track $title
    default: Album/%bucket{$albumartist}/$albumartist/[$year] $album%aunique{} [$format]/%if{$multidisc,disc $disc }%if{$disctitle,$disctitle}/$track $title

how would i modify the “comp: Various Artists/$album%aunique{}…” line without "braking everything?
I guess with a couple of if-statements, but i’m no good at this.
What i’m trying to achive is, that every album that has genre “jazz” goes to subdir; every album that is “MPB” goes to "subdir “MBP” i’m not shure what will happen to electronic jazz, but we’ll see later :wink:
Thank you very much for your help

Maybe something like this would work? (Not sure, so give it a try on one song before letting it move your whole library!)

"comp:1 genre:jazz": Various Artists/Jazz/$album%aunique{} [$year] [$format]/%if{$disctitle,$disctitle/}$track $artist - $title

Well, that kind of worked, but it has undesired side effects :wink:
so i changed the path config to

#comp: Various Artists/$album%aunique{} [$year]$atypes [$format]/%if{$disctitle,$disctitle/}$track $artist - $title
    "comp:1 genre:jazz": Various Artists/++JAZZ/$album%aunique{} [$year] [$format]/%if{$disctitle,$disctitle/}$track $artist - $title
    "comp:1 genre:Electronic": Various Artists/++ELECTRONIC/$album%aunique{} [$year] [$format]/%if{$disctitle,$disctitle/}$track $artist - $title
    "comp:1 genre:Bossa Nova": Various Artists/++BOSSA NOVA/$album%aunique{} [$year] [$format]/%if{$disctitle,$disctitle/}$track $artist - $title
    "comp:1 genre:World Music": Various Artists/++WORLD/$album%aunique{} [$year] [$format]/%if{$disctitle,$disctitle/}$track $artist - $title

i had to comment out the original line, otherwise it would not work.
Now i get Albums with an unambiguous genre tag correctly sorted to the subdirs.

I get Problems with albums where the genre list says ie. “Electronic, Techno, Ambient, Jazz, Pop, Experimental, Hip-Hop” — because for some unknown reason that album was sorted to ++JAZZ by beets while it is definitely Electronic

Furthermore, some albums were sorted to a new directory named compilations, and i don’t know where this comes from because i never defined that.

Last but not least, i don’t know what that “comp:1 genre:” does 0:-)
Where could i read about these expressions? At first glance i didn’t find it in documentation

Thanks a lot for your help

Maybe a good thing to keep in mind is that order matters: beets tries the first pattern first and, if it doesn’t match, moves onto the next one. So you’ll want to move the most general patterns last. Details are in the docs here:

To match an empty field, you can use a regex query like genre::^$. As described here:

1 Like