30 lines
638 B
Bash
30 lines
638 B
Bash
#!/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
|
||
|
|
|