parent
33ed87f75c
commit
ab611227cc
@ -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
|
||||||
|
|
||||||
@ -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
|
||||||
|
|
||||||
Loading…
Reference in new issue