commit 16ef3b3cb8b3dfed40e1b9a697ceb3f229e97baa parent 8fbea3f8f838ad041c16ce207ec69d0fa8b152a0 Author: Alex Balgavy <alex@balgavy.eu> Date: Mon, 22 Nov 2021 19:10:25 +0100 mp3-tags-to-folders: also use album artist instead of artist Diffstat:
M | scripts/mp3-tags-to-folders | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/mp3-tags-to-folders b/scripts/mp3-tags-to-folders @@ -10,10 +10,10 @@ cd "$2" || die "Could not cd to $1" mkdir -p _failed || die "Directory ./_failed already exists" find "$1" -name "*.mp3" 2>/dev/null | \ while read -r i; do - artist="$(ffprobe -loglevel error -show_entries format_tags=artist -of default=noprint_wrappers=1:nokey=1 "$i" | tr -d ':' | tr '!@#$%^&*:?"' '_' | sed 's/\.\.*$//')" - [ $? -eq 0 ] || { mv "$i" _failed/ && continue; } - album="$(ffprobe -loglevel error -show_entries format_tags=album -of default=noprint_wrappers=1:nokey=1 "$i" | tr -d ':' | tr '!@#$%^&*:?"' '_' | sed 's/\.\.*$//')" - [ $? -eq 0 ] || { mv "$i" _failed/ && continue; } + artist="$(ffprobe -loglevel error -show_entries format_tags=album_artist -of default=noprint_wrappers=1:nokey=1 "$i" | tr -d ':' | tr '!@#$%^&*:?"\\>' '_' | sed 's/\.\.*$//')" + [ -n "$artist" ] || { mv "$i" _failed/ && continue; } + album="$(ffprobe -loglevel error -show_entries format_tags=album -of default=noprint_wrappers=1:nokey=1 "$i" | tr -d ':' | tr '!@#$%^&*:?>\\"' '_' | sed 's/\.\.*$//')" + [ -n "$album" ] || { mv "$i" _failed/ && continue; } mkdir -p "$artist/$album" mv "$i" "$artist/$album" done