Hash :
cd3750a4
Author :
Thomas de Grivel
Date :
2021-02-14T10:13:06
#!/bin/sh
set -e
FILE="$1"
eval `get-tag "$FILE" | grep -E '^[A-Z]*=\"[^\"]*\"$'`
linkto() {
DIR="$1"
mkdir -p "$DIR"
if ! ln -sf "$FILE" "$DIR"; then
echo "$FILE" >> _dup.txt
fi
}
if [ -z "$ARTIST" ] || [ -z "$ALBUM" ] || [ -z "$TYPE" ] || [ -z "$GENRE" ] || [ -z "$DATE" ]; then
echo "$FILE" >> _tag.txt
else
echo "# $ARTIST # $ALBUM # $DATE # $GENRE # $TYPE #"
echo "$FILE"
linkto "_artist/${ARTIST}/${ALBUM}"
linkto "_genre/${GENRE}/${ARTIST}/${ALBUM}"
linkto "_year/${DATE}/${ARTIST}/${ALBUM}"
linkto "_${TYPE}/${ARTIST}/${ALBUM}"
linkto "_${TYPE}/_genre/${GENRE}/${ARTIST}/${ALBUM}"
linkto "_${TYPE}/_year/${DATE}/${ARTIST}/${ALBUM}"
fi