From dd5dbdb734de3efd177fe4440a9d385d17ee5e8d Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sun, 16 Dec 2018 19:24:59 +0100 Subject: Created non-working music sorter script. --- musicSorter.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 musicSorter.sh diff --git a/musicSorter.sh b/musicSorter.sh new file mode 100755 index 0000000..cf65400 --- /dev/null +++ b/musicSorter.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +count=0 +files="${1}/*.mp3" +for file in $files; do + count=$(($count+1)) + echo "File $count: $file" >> "$1/filelist.txt" + artist=$(tagmp3 show "$file" | grep "Artist" | cut -d' ' -f7- | xargs) + if [ -n "$artist" ]; then + if [ -z "$(ls $1 | grep "$artist")" ]; then + mkdir -p "$1/$artist" + fi + target="$1/$artist/$(basename "$file")" + mv -f "$file" "$target" + fi +done -- cgit v1.2.1