So… I’m using beets to try to wrangle a decades-old jumble of mp3s from every source under the sun into something resembling a library. It’s an interesting challenge! So far, I have chroma, discogs, and fromfilename working, and with the help of $albumartist_sort
, $artist_sort
, asciify_paths: yes
and languages: en
, I’m no longer creating folders on my computer with names in scripts I can’t read. We’re getting there!
My current problem is albums and singletons from “Artist feat. Guest” and all its variations. I do not want to remove this information from the files’ metadata fields, but I do want the Path format to sort all entries credited to “Artist feat. Guest” and “Artist & Collaborator” and so forth into the “Artist” folder. Given the amount of pattern-matching logic available in Path’s fields and functions and so forth, I expect this is possible, but I’d love some pointers on how to actually write it. I’m picturing something along the lines of:
%if{$artist_sort contains <any member of $feat_words_list>,%first{,1,,<whichever word matched>,},$artist_sort}
…but as you can see, there are some gaps:
- how (where) do I define
$feat_words_list
? - how do I pass the individual word that matched to
%first
? - will this leave me with a trailing space?
Am I even on the right track here? Has somebody already written a plugin for this that I just haven’t found? Do I need to use the Inline plugin and see if I can cobble together a little Python function of my own?
Also, Adrian, would there be any interest in adding a built-in Path function like %strip_feat{}
that would take a string as input and return the same string, but truncated right before the first occurrence of any one of a list of join-words? (Assuming I haven’t overlooked this functionality somewhere, of course.)
This post brought to you by:
-
Apocalyptica feat. Jandova, Marta
, -
Apocalyptica feat. Lombardo, Dave
, -
Apocalyptica feat. Sundblad, Linda
, -
Apocalyptica feat. Ylonen, Lauri
, and Apocalyptica & Hagen, Nina
…all of whom have top-level folders containing one singleton each in my practice-sandbox beets collection.