If a file has both embedded cover art and cover art in its directory,
both commands will return data and mpdthumb prints two lines instead
of one as expected. Fix this by skipping the check for albumart data
if valid readpicture data was returned.
#!/bin/sh
#
-# Copyright © 2019-2021 Nick Bowler
+# Copyright © 2019-2022 Nick Bowler
#
# Generate thumbnails for cover art retrieved from MPD.
#
prevn=$# file=$1 mode=$a; shift || exit; continue
;;
size:)
+ if test x"$mode/$valid" = x"albumart/readpicture$prevn"; then
+ # readpicture result was OK, skip over albumart result
+ continue
+ fi
valid=$mode$#
;;
ACK)