configs/arch-config/scripts/pieces/music-delete-normalized.sh

28 lines
539 B
Bash
Raw Normal View History

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
ls -d */ > artistdirectories
2021-01-20 20:53:23 +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"
done < directories
# cleanup
rm directories
2023-11-25 15:45:25 +01:00
cd "$HOME/Nextcloud/MusikRaw"
done < artistdirectories
# cleanup
rm artistdirectories
2021-01-22 14:46:34 +01:00
exit