From 4464a71e9bee10cfccfaf652d20c688b13cad11d Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 9 Feb 2022 20:00:49 -0500 Subject: [PATCH] mpdthumb: Fix failure when readpicture/albumart both return data. 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. --- mpdthumb.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mpdthumb.sh b/mpdthumb.sh index 4faf7a6..e87f837 100755 --- a/mpdthumb.sh +++ b/mpdthumb.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright © 2019-2021 Nick Bowler +# Copyright © 2019-2022 Nick Bowler # # Generate thumbnails for cover art retrieved from MPD. # @@ -204,6 +204,10 @@ while read a b <&6; do 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) -- 2.43.0