Merge pull request #10 from rubdos/cover.jpg

Support `cover.{jpg,png}`.
This commit is contained in:
Siddharth Dushantha 2019-02-22 06:32:01 +01:00 committed by GitHub
commit db7432b07e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

14
kunst
View File

@ -115,6 +115,20 @@ update_cover() {
echo "kunst: extracted album art" echo "kunst: extracted album art"
ARTLESS=false ARTLESS=false
else 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" echo "error: file does not have an album art"
get_cover_online get_cover_online
fi fi