Files
Lucas Vivohost 7c2e0db615 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
2026-09-14 12:43:38 +02:00

31 lines
638 B
Bash
Executable File

#!/usr/bin/env bash
shopt -s globstar nullglob
root="${1:-.}"
for file in "$root"/**/*; do
[[ -f "$file" ]] || continue
case "${file##*.}" in
epub|EPUB)
continue
;;
nfo|NFO)
grouping="$(grep -i 'Series Name:' "$file" 2>/dev/null | sed 's/^[Ss]eries:[[:space:]]*//')"
;;
m4b|M4B|m4a|M4A|mp3|MP3|aac|AAC|flac|FLAC)
grouping="$(kid3-cli -c "get grouping" "$file" 2>/dev/null)"
;;
*)
continue
;;
esac
if [[ ! "$grouping" =~ Publication ]]; then
echo Grouping: $grouping
echo "$file"
fi
done