2023-11-25 15:45:25 +01:00
|
|
|
#!/usr/bin/env bash
|
2021-01-20 20:53:23 +01:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# change into music raw folder
|
2023-11-25 15:45:25 +01:00
|
|
|
cd "$HOME/Nextcloud/MusikRaw"
|
2021-01-20 20:53:23 +01:00
|
|
|
|
|
|
|
# get directories
|
2021-02-12 12:29:58 +01:00
|
|
|
ls -d */ > artistdirectories
|
2021-01-20 20:53:23 +01:00
|
|
|
|
2021-02-12 12:29:58 +01:00
|
|
|
while read -r artdir; do
|
|
|
|
cd "$artdir"
|
|
|
|
# get albums
|
|
|
|
ls -d */ > directories
|
|
|
|
# delete normalized from albums
|
|
|
|
while read -r dir; do
|
|
|
|
cd "$dir"
|
|
|
|
rm -rf normalized
|
2023-11-25 15:45:25 +01:00
|
|
|
cd "$HOME/Nextcloud/MusikRaw/$artdir"
|
2021-02-12 12:29:58 +01:00
|
|
|
done < directories
|
|
|
|
# cleanup
|
|
|
|
rm directories
|
2023-11-25 15:45:25 +01:00
|
|
|
cd "$HOME/Nextcloud/MusikRaw"
|
2021-02-12 12:29:58 +01:00
|
|
|
done < artistdirectories
|
|
|
|
# cleanup
|
|
|
|
rm artistdirectories
|
2021-01-22 14:46:34 +01:00
|
|
|
|
|
|
|
exit
|