diff options
| author | shipwreckt <me@shipwreckt.co.uk> | 2025-08-18 12:01:10 +0100 |
|---|---|---|
| committer | shipwreckt <me@shipwreckt.co.uk> | 2025-08-18 12:01:10 +0100 |
| commit | e8b5675eb77aa20027f369ca278457b6a7c2e142 (patch) | |
| tree | 9b96e37beb5d27a6bf70b6b2f69c61e6012be914 /files/old-config/mpd/scripts/album.sh | |
| parent | c9e7170faff3e352eef5619dedf7a12e68ca610d (diff) | |
Some changes to my Nvim setup!
Diffstat (limited to 'files/old-config/mpd/scripts/album.sh')
| -rw-r--r-- | files/old-config/mpd/scripts/album.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/files/old-config/mpd/scripts/album.sh b/files/old-config/mpd/scripts/album.sh new file mode 100644 index 0000000..b705f3e --- /dev/null +++ b/files/old-config/mpd/scripts/album.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Path to your music directory +music_dir="Music/Dead_Kennedys" + +# Loop through all FLAC files in the directory and its subdirectories +find "$music_dir" -type f -name "*.flac" | while read -r file; do + # Extract the current ALBUM metadata + raw_album=$(metaflac --show-tag=ALBUM "$file") + + # Check if the ALBUM tag exists + if [[ "$raw_album" == ALBUM=* ]]; then + # Extract the actual album name + album_name=$(echo "$raw_album" | sed 's/^ALBUM=//') + + # Format the album name: capitalize the first letter of each word + capitalized_album=$(echo "$album_name" | sed -e 's/\b\(.\)/\U\1/g') + + # Remove the original ALBUM tag + metaflac --remove-tag=ALBUM "$file" + + # Set the new ALBUM tag with the properly capitalized name + metaflac --set-tag=ALBUM="$capitalized_album" "$file" + + echo "Updated album metadata for: $file -> $capitalized_album" + else + echo "No ALBUM metadata found for: $file" + fi +done + |
