Is there a quick and dirty way to replace all ARTIST tags with what's in the ALBUMARTIST field?

The title says it all. I need to dump all my music to a device that doesn’t support the ALBUMARTIST tag.

I’m sure I can write a python script to do it using mutagen, but if beets has some way to do it, I would love to go that route.

beets doesn’t yet support formatted modify, so your best bet is probably to write a beets plugin.

1 Like

@apastuszak Here is a shell script that writes the albumartist value into the artist field for every track in your collection:

beet ls -f '$path :: $albumartist' | while read line
do
safeline=$(echo "$line" | sed "s/'/'\\\\''/g") # escape single quote marks
p=${safeline% :: *}
albumartist=${safeline#* :: }
test "$albumartist" &&
  echo "beet modify path:'$p' artist='$albumartist'" ||
  echo "[WARNING] No albumartist for track: ${line% :: *}"
done

Well, it doesn’t actually write anything… rather, it generates beet commands to do it track by track, so that you can review the results before actually doing it. So it should be safe to cut-and-paste and play around with, without nuking anything.

1 Like

Thanks! This is going to save me a lot of time.

1 Like