#!/bin/bash # Sets ALBUMARTIST to all *.flac recursively to the name of the current folder # Meant to be run in the artist folder to fix the tags off all artist's songs album_artist=$(basename $(pwd)) # Ensure metaflac is installed if ! command -v metaflac &> /dev/null; then echo "metaflac is required but not installed. Exiting." exit 1 fi # Find and update all .flac files recursively find . -type f -iname "*.flac" | while IFS= read -r flac; do echo "Updating ALBUMARTIST in '$flac'..." metaflac --remove-tag=ALBUMARTIST "$flac" metaflac --set-tag="ALBUMARTIST=$album_artist" "$flac" done echo "All matching FLAC files updated."