diff --git a/add_replay_gain.sh b/add_replay_gain.sh new file mode 100755 index 0000000..e587d2a --- /dev/null +++ b/add_replay_gain.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Find all directories two levels deep (Artist/Album) containing FLAC files +find . -type f -iname "*.flac" | \ + awk -F/ 'NF>=3 {print $(NF-2) "/" $(NF-1)}' | sort -u | while read -r album_path; do + full_album_path="./$album_path" + echo "Processing album: $full_album_path" + + # Run metaflac on all FLAC files in the album directory + metaflac --add-replay-gain "$full_album_path"/*.flac +done + diff --git a/fix_single_path.sh b/fix_single_path.sh new file mode 100755 index 0000000..17528f9 --- /dev/null +++ b/fix_single_path.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Find all .flac files that are directly inside an Artist/ folder (depth = 2) +find . -mindepth 2 -maxdepth 2 -type f -iname "*.flac" | while read -r file; do + dir_path="$(dirname "$file")" + base_name="$(basename "$file" .flac)" + new_folder="$dir_path/$base_name" + new_path="$new_folder/$(basename "$file")" + + # Create a new folder and move the file + echo "Moving: $file → $new_path" + mkdir -p "$new_folder" + mv "$file" "$new_path" +done +