Support `cover.{jpg,png}`.

Fixes #9
This commit is contained in:
Ruben De Smet 2019-02-21 16:49:27 +01:00
parent 5eaef879b7
commit 19fb55b742
1 changed files with 14 additions and 0 deletions

14
kunst
View File

@ -115,6 +115,20 @@ update_cover() {
echo "kunst: extracted album art"
ARTLESS=false
else
DIR="$MUSIC_DIR$(dirname "$(mpc current -f %file%)")"
echo "kunst: inspecting $DIR"
for CANDIDATE in "$DIR/cover."{png,jpg}; do
if [ -f "$CANDIDATE" ]; then
STATUS=0
ARTLESS=false
convert "$CANDIDATE" $COVER
echo "kunst: found cover.png"
fi
done
fi
if [ $STATUS -ne 0 ];then
echo "error: file does not have an album art"
get_cover_online
fi