Rename a folder?


#1

Hey guys. First off, I LOVE beets!!! I purchased Jaikoz years and years ago to organize my music collection but really never used it. Over the last week, I’ve used beets to organize most of my collection. Thanks for your hard work!

I think my question is simple enough, however searching the excellent docs just doesn’t help. I’d like to suggest more examples, if possible. I have a large collection of compilations, and would like to rename a few of the folders. For example, I have:

The Encyclopedia of Jazz, Part 1 5 - Classic Jazz - From New Orleans to Harlem

The actual album name has a slash between 1 and 5, however beets replaces this with a space (I changed it from an underscore). I’d like to rename it to:

The Encyclopedia of Jazz, Part 1 of 5 - Classic Jazz - From New Orleans to Harlem

Notice the “of”. If possible, I only want to rename the folder and not the metadata in the music files. However, if it’s an all or nothing solution, I’ll take it.

I think I need to use either move or edit, but unfortunately, I cannot find any examples.

Any advice would be appreciated.

Thanks!


#2

Hi! The beets philosophy is that filenames are always generated by rules from fields, so you don’t modify them manually.

To do what you want, I’d suggest using modify to set a new field—let’s call it $altalbum instead of $album—to the “alternative” name for the album you want to use in filenames. Then use something like %ifdef{altalbum,$altalbum,$album} in your path format to use this name while falling back to the “real” album name.


#3

Thanks for your reply. In that case, would I be able to just alter the album name from “… 1/5…” to “… 1 of 5…” then have beets update the paths? Or does this go against standard practice?


#4

Yes, that will work and is fine! But it will also change the tags (by default, at least).