From 77e25452a79b824e6c080e3b77ecc221ad5ff690 Mon Sep 17 00:00:00 2001 From: Gabe Farrell Date: Tue, 29 Apr 2025 23:10:02 +0000 Subject: [PATCH] bleh --- set_albumartist_to_all_flac.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 set_albumartist_to_all_flac.sh diff --git a/set_albumartist_to_all_flac.sh b/set_albumartist_to_all_flac.sh new file mode 100755 index 0000000..62db879 --- /dev/null +++ b/set_albumartist_to_all_flac.sh @@ -0,0 +1,25 @@ +#!/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." +