You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
596 B
26 lines
596 B
#!/bin/bash
|
|
|
|
# Check for required argument
|
|
if [ $# -ne 1 ]; then
|
|
echo "Usage: $0 \"ALBUMARTIST name\""
|
|
exit 1
|
|
fi
|
|
|
|
album_artist="$1"
|
|
|
|
# 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."
|
|
|