metadata scripts

album from folder: create album from foldername
read: read and display author, album, grouping of every folder
remove author before title: remove "name - " when matching author
This commit is contained in:
Lucas Vivohost committed 2026-09-14 12:43:38 +02:00
1 parent 408566b6ea
commit 7c2e0db615
11 files changed
+114 -18

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
cd $1
for d in */; do
album="${d%/}"
# Remove leading numbering: "001 - "
album=$(echo "$album" | sed -E 's/^[0-9]+[[:space:]]*-[[:space:]]*//')
album=$(echo "$album" | sed -E 's/^\([^)]*\)[[:space:]]*//; s/[[:space:]]*\([^)]*\)$//')
# Remove all (...) groups
album=$(echo "$album" | sed -E 's/$$[^)]*$$//g')
# Remove all [...] groups
album=$(echo "$album" | sed -E 's/$$[^]]*$$//g')
# Remove standalone years
album=$(echo "$album" | sed -E 's/[[:space:]]+[12][0-9]{3}//g')
# Collapse multiple spaces and trim
album=$(echo "$album" | sed -E 's/[[:space:]]+/ /g; s/^ //; s/ $//')
echo "Setting album: $album"
cd "$d" || continue
for x in *; do
[ -f "$x" ] || continue
kid3-cli -c "set album \"$album\"" -c save "$x"
done
cd ..
done